]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
kernel-netlink: Make sure we successfully opened a Netlink socket
authorTobias Brunner <tobias@strongswan.org>
Tue, 17 Nov 2020 16:55:24 +0000 (17:55 +0100)
committerTobias Brunner <tobias@strongswan.org>
Thu, 3 Dec 2020 07:34:18 +0000 (08:34 +0100)
This is in addition to the fix in the destructor in 991e9e5dc9.

src/libcharon/plugins/kernel_netlink/kernel_netlink_net.c

index 3412877ad9b1957f93862de07b975550fc75debf..3e6e64cfd81fe63bdc96569821707d2f8c3a29ed 100644 (file)
@@ -3159,6 +3159,12 @@ kernel_netlink_net_t *kernel_netlink_net_create()
 
        check_kernel_features(this);
 
+       if (!this->socket)
+       {
+               destroy(this);
+               return NULL;
+       }
+
        if (streq(lib->ns, "starter"))
        {       /* starter has no threads, so we do not register for kernel events */
                register_for_events = FALSE;