aboutsummaryrefslogtreecommitdiff
path: root/net/core
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-04-16 02:01:56 -0700
committerDavid S. Miller <davem@davemloft.net>2008-04-16 02:01:56 -0700
commit3661a910836a509be65afc3c1e512d900e1280f9 (patch)
treee3b0dee72a200f0214cfe359f66f977cf01b5ec2 /net/core
parent48115becf6ad9c0e700ff7c1792b7f2a288ef8fb (diff)
[NETNS]: Add netns refcnt debug to fib rules.
Signed-off-by: Denis V. Lunev <den@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/fib_rules.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c
index 540c07283e3..e3e9ab0f74e 100644
--- a/net/core/fib_rules.c
+++ b/net/core/fib_rules.c
@@ -29,7 +29,7 @@ int fib_default_rule_add(struct fib_rules_ops *ops,
r->pref = pref;
r->table = table;
r->flags = flags;
- r->fr_net = ops->fro_net;
+ r->fr_net = hold_net(ops->fro_net);
/* The lock is not required here, the list in unreacheable
* at the moment this function is called */
@@ -243,7 +243,7 @@ static int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
err = -ENOMEM;
goto errout;
}
- rule->fr_net = net;
+ rule->fr_net = hold_net(net);
if (tb[FRA_PRIORITY])
rule->pref = nla_get_u32(tb[FRA_PRIORITY]);
@@ -344,6 +344,7 @@ static int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
return 0;
errout_free:
+ release_net(rule->fr_net);
kfree(rule);
errout:
rules_ops_put(ops);