Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172043
b: refs/heads/master
c: e8d0288
h: refs/heads/master
i:
  172041: 3707eec
  172039: 8d76023
v: v3
  • Loading branch information
Eric W. Biederman authored and David S. Miller committed Dec 2, 2009
1 parent 717240e commit 94e2c39
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 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: 32b51f92d858dd3002ec2240960b772518a6803b
refs/heads/master: e8d02885997081f09272af6b9a27061a142da4c5
20 changes: 6 additions & 14 deletions trunk/net/netfilter/nf_conntrack_proto_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,32 +300,24 @@ static struct nf_conntrack_l4proto nf_conntrack_l4proto_gre4 __read_mostly = {

static int proto_gre_net_init(struct net *net)
{
struct netns_proto_gre *net_gre;
int rv;
struct netns_proto_gre *net_gre = net_generic(net, proto_gre_net_id);

net_gre = kmalloc(sizeof(struct netns_proto_gre), GFP_KERNEL);
if (!net_gre)
return -ENOMEM;
rwlock_init(&net_gre->keymap_lock);
INIT_LIST_HEAD(&net_gre->keymap_list);

rv = net_assign_generic(net, proto_gre_net_id, net_gre);
if (rv < 0)
kfree(net_gre);
return rv;
return 0;
}

static void proto_gre_net_exit(struct net *net)
{
struct netns_proto_gre *net_gre = net_generic(net, proto_gre_net_id);

nf_ct_gre_keymap_flush(net);
kfree(net_gre);
}

static struct pernet_operations proto_gre_net_ops = {
.init = proto_gre_net_init,
.exit = proto_gre_net_exit,
.id = &proto_gre_net_id,
.size = sizeof(struct netns_proto_gre),
};

static int __init nf_ct_proto_gre_init(void)
Expand All @@ -335,7 +327,7 @@ static int __init nf_ct_proto_gre_init(void)
rv = nf_conntrack_l4proto_register(&nf_conntrack_l4proto_gre4);
if (rv < 0)
return rv;
rv = register_pernet_gen_subsys(&proto_gre_net_id, &proto_gre_net_ops);
rv = register_pernet_subsys(&proto_gre_net_ops);
if (rv < 0)
nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_gre4);
return rv;
Expand All @@ -344,7 +336,7 @@ static int __init nf_ct_proto_gre_init(void)
static void __exit nf_ct_proto_gre_fini(void)
{
nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_gre4);
unregister_pernet_gen_subsys(proto_gre_net_id, &proto_gre_net_ops);
unregister_pernet_subsys(&proto_gre_net_ops);
}

module_init(nf_ct_proto_gre_init);
Expand Down

0 comments on commit 94e2c39

Please sign in to comment.