]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ovpn: ensure TCP vars are initialized first
authorAntonio Quartulli <antonio@openvpn.net>
Tue, 28 Jul 2026 11:48:54 +0000 (13:48 +0200)
committerAntonio Quartulli <antonio@openvpn.net>
Thu, 30 Jul 2026 09:28:30 +0000 (11:28 +0200)
Netlink calls may access TCP global vars (i.e. when attaching
a TCP socket), therefore we need to make sure the
latters are initialized beforehand.

For this reason move the global TCP initialization at the top
of the module init function.

Fixes: 11851cbd60ea ("ovpn: implement TCP transport")
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
drivers/net/ovpn/main.c

index 3a04757d5c31e1dddde026878ce7925d6f3a903f..168cfe9b59a98a4a8ee9f5ec0da0ce842d4ffa1f 100644 (file)
@@ -260,8 +260,11 @@ static struct rtnl_link_ops ovpn_link_ops = {
 
 static int __init ovpn_init(void)
 {
-       int err = rtnl_link_register(&ovpn_link_ops);
+       int err;
 
+       ovpn_tcp_init();
+
+       err = rtnl_link_register(&ovpn_link_ops);
        if (err) {
                pr_err("ovpn: can't register rtnl link ops: %d\n", err);
                return err;
@@ -273,8 +276,6 @@ static int __init ovpn_init(void)
                goto unreg_rtnl;
        }
 
-       ovpn_tcp_init();
-
        return 0;
 
 unreg_rtnl: