]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
kernel-pfroute: Always listen for events
authorTobias Brunner <tobias@strongswan.org>
Thu, 26 Jan 2023 15:19:22 +0000 (16:19 +0100)
committerTobias Brunner <tobias@strongswan.org>
Thu, 16 Feb 2023 12:25:35 +0000 (13:25 +0100)
The starter-specific code path isn't necessary anymore since
d8fdd1018e16 ("starter: Don't flush SAs in the kernel").

src/libcharon/plugins/kernel_pfroute/kernel_pfroute_net.c

index acc22902c5f87fb3be756d2eacb96ba335834cb7..b933b7c92ed9013263f9d7586aca15c49ef76204 100644 (file)
@@ -2114,21 +2114,9 @@ kernel_pfroute_net_t *kernel_pfroute_net_create()
                destroy(this);
                return NULL;
        }
+       lib->watcher->add(lib->watcher, this->socket, WATCHER_READ,
+                                         (watcher_cb_t)receive_events, this);
 
-       if (streq(lib->ns, "starter"))
-       {
-               /* starter has no threads, so we do not register for kernel events */
-               if (shutdown(this->socket, SHUT_RD) != 0)
-               {
-                       DBG1(DBG_KNL, "closing read end of PF_ROUTE socket failed: %s",
-                                strerror(errno));
-               }
-       }
-       else
-       {
-               lib->watcher->add(lib->watcher, this->socket, WATCHER_READ,
-                                                 (watcher_cb_t)receive_events, this);
-       }
        if (init_address_list(this) != SUCCESS)
        {
                DBG1(DBG_KNL, "unable to get interface list");