Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 184189
b: refs/heads/master
c: c2892f0
h: refs/heads/master
i:
  184187: 0e101d0
v: v3
  • Loading branch information
Alexey Dobriyan authored and David S. Miller committed Feb 16, 2010
1 parent 9e463cc commit 05cf967
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 749f621e20ab0db35a15ff730088922603c809ba
refs/heads/master: c2892f02712e9516d72841d5c019ed6916329794
19 changes: 10 additions & 9 deletions trunk/net/ipv4/ip_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -1665,14 +1665,15 @@ static int __init ipgre_init(void)

printk(KERN_INFO "GRE over IPv4 tunneling driver\n");

if (inet_add_protocol(&ipgre_protocol, IPPROTO_GRE) < 0) {
printk(KERN_INFO "ipgre init: can't add protocol\n");
return -EAGAIN;
}

err = register_pernet_device(&ipgre_net_ops);
if (err < 0)
goto gen_device_failed;
return err;

err = inet_add_protocol(&ipgre_protocol, IPPROTO_GRE);
if (err < 0) {
printk(KERN_INFO "ipgre init: can't add protocol\n");
goto add_proto_failed;
}

err = rtnl_link_register(&ipgre_link_ops);
if (err < 0)
Expand All @@ -1688,19 +1689,19 @@ static int __init ipgre_init(void)
tap_ops_failed:
rtnl_link_unregister(&ipgre_link_ops);
rtnl_link_failed:
unregister_pernet_device(&ipgre_net_ops);
gen_device_failed:
inet_del_protocol(&ipgre_protocol, IPPROTO_GRE);
add_proto_failed:
unregister_pernet_device(&ipgre_net_ops);
goto out;
}

static void __exit ipgre_fini(void)
{
rtnl_link_unregister(&ipgre_tap_ops);
rtnl_link_unregister(&ipgre_link_ops);
unregister_pernet_device(&ipgre_net_ops);
if (inet_del_protocol(&ipgre_protocol, IPPROTO_GRE) < 0)
printk(KERN_INFO "ipgre close: can't remove protocol\n");
unregister_pernet_device(&ipgre_net_ops);
}

module_init(ipgre_init);
Expand Down

0 comments on commit 05cf967

Please sign in to comment.