History

ovpn: ensure TCP vars are initialized first

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.

Antonio Quartulli committed 3 months ago

Commit 4680c0e1 parent 0301aa31 file · +4 −3Browse files

Unified · Split

drivers/net/ovpn/main.c+4−3
@@ -260,8 +260,11 @@ static struct rtnl_link_ops ovpn_link_ops = { · 259 unmodified lines
260 260
261static int __init ovpn_init(void)261static int __init ovpn_init(void)
262{262{
263 int err = rtnl_link_register(&ovpn_link_ops);263 int err;
264 264
265 ovpn_tcp_init();
266
267 err = rtnl_link_register(&ovpn_link_ops);
265 if (err) {268 if (err) {
266 pr_err("ovpn: can't register rtnl link ops: %d\n", err);269 pr_err("ovpn: can't register rtnl link ops: %d\n", err);
267 return err;270 return err;
@@ -273,8 +276,6 @@ static int __init ovpn_init(void) · 5 unmodified lines
273 goto unreg_rtnl;276 goto unreg_rtnl;
274 }277 }
275 278
276 ovpn_tcp_init();
277
278 return 0;279 return 0;
279 280
280unreg_rtnl:281unreg_rtnl:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t