]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
tun-device: Also close IPv6 socket on destruction
authorMarkus Theil <markus.theil@secunet.com>
Fri, 10 Apr 2026 19:25:19 +0000 (21:25 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 13 Apr 2026 13:13:14 +0000 (15:13 +0200)
Signed-off-by: Markus Theil <markus.theil@secunet.com>
src/libstrongswan/networking/tun_device.c

index b239b2e593357d7112bed368e738875f0c30007b..49cb54f4ebc01612575725fae9d2cf9cc2a404e1 100644 (file)
@@ -500,6 +500,10 @@ METHOD(tun_device_t, destroy, void,
        {
                close(this->sock);
        }
+       if (this->sock_v6 > 0)
+       {
+               close(this->sock_v6);
+       }
        DESTROY_IF(this->address);
        free(this);
 }
@@ -650,6 +654,7 @@ tun_device_t *tun_device_create(const char *name_tmpl)
                },
                .tunfd = -1,
                .sock = -1,
+               .sock_v6 = -1,
        );
 
        if (!init_tun(this, name_tmpl))