diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-25 13:26:21 -0400 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-25 15:39:55 -0400 |
commit | 3b1e0a655f8eba44ab1ee2a1068d169ccfb853b9 (patch) | |
tree | 09edb35f32ebcfb1b4dad904425128a110ef16ee /net/core/fib_rules.c | |
parent | c346dca10840a874240c78efe3f39acf4312a1f2 (diff) |
[NET] NETNS: Omit sock->sk_net without CONFIG_NET_NS.
Introduce per-sock inlines: sock_net(), sock_net_set()
and per-inet_timewait_sock inlines: twsk_net(), twsk_net_set().
Without CONFIG_NET_NS, no namespace other than &init_net exists.
Let's explicitly define them to help compiler optimizations.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/core/fib_rules.c')
-rw-r--r-- | net/core/fib_rules.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/core/fib_rules.c b/net/core/fib_rules.c index 942be93a2eb0..540c07283e31 100644 --- a/net/core/fib_rules.c +++ b/net/core/fib_rules.c | |||
@@ -214,7 +214,7 @@ errout: | |||
214 | 214 | ||
215 | static int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) | 215 | static int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) |
216 | { | 216 | { |
217 | struct net *net = skb->sk->sk_net; | 217 | struct net *net = sock_net(skb->sk); |
218 | struct fib_rule_hdr *frh = nlmsg_data(nlh); | 218 | struct fib_rule_hdr *frh = nlmsg_data(nlh); |
219 | struct fib_rules_ops *ops = NULL; | 219 | struct fib_rules_ops *ops = NULL; |
220 | struct fib_rule *rule, *r, *last = NULL; | 220 | struct fib_rule *rule, *r, *last = NULL; |
@@ -352,7 +352,7 @@ errout: | |||
352 | 352 | ||
353 | static int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) | 353 | static int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) |
354 | { | 354 | { |
355 | struct net *net = skb->sk->sk_net; | 355 | struct net *net = sock_net(skb->sk); |
356 | struct fib_rule_hdr *frh = nlmsg_data(nlh); | 356 | struct fib_rule_hdr *frh = nlmsg_data(nlh); |
357 | struct fib_rules_ops *ops = NULL; | 357 | struct fib_rules_ops *ops = NULL; |
358 | struct fib_rule *rule, *tmp; | 358 | struct fib_rule *rule, *tmp; |
@@ -534,7 +534,7 @@ skip: | |||
534 | 534 | ||
535 | static int fib_nl_dumprule(struct sk_buff *skb, struct netlink_callback *cb) | 535 | static int fib_nl_dumprule(struct sk_buff *skb, struct netlink_callback *cb) |
536 | { | 536 | { |
537 | struct net *net = skb->sk->sk_net; | 537 | struct net *net = sock_net(skb->sk); |
538 | struct fib_rules_ops *ops; | 538 | struct fib_rules_ops *ops; |
539 | int idx = 0, family; | 539 | int idx = 0, family; |
540 | 540 | ||