aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/icmp.c
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-03-25 08:47:49 -0400
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-03-25 15:39:53 -0400
commitc346dca10840a874240c78efe3f39acf4312a1f2 (patch)
treec04cff20124eba5cc337cc5ec260ad2513eeb065 /net/ipv4/icmp.c
parent7cbca67c073263c179f605bdbbdc565ab29d801d (diff)
[NET] NETNS: Omit net_device->nd_net without CONFIG_NET_NS.
Introduce per-net_device inlines: dev_net(), dev_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/ipv4/icmp.c')
-rw-r--r--net/ipv4/icmp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index ff9a8e643fcc..f38f093ef751 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -351,7 +351,7 @@ static void icmp_push_reply(struct icmp_bxm *icmp_param,
351 struct sock *sk; 351 struct sock *sk;
352 struct sk_buff *skb; 352 struct sk_buff *skb;
353 353
354 sk = icmp_sk(rt->u.dst.dev->nd_net); 354 sk = icmp_sk(dev_net(rt->u.dst.dev));
355 if (ip_append_data(sk, icmp_glue_bits, icmp_param, 355 if (ip_append_data(sk, icmp_glue_bits, icmp_param,
356 icmp_param->data_len+icmp_param->head_len, 356 icmp_param->data_len+icmp_param->head_len,
357 icmp_param->head_len, 357 icmp_param->head_len,
@@ -382,7 +382,7 @@ static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb)
382{ 382{
383 struct ipcm_cookie ipc; 383 struct ipcm_cookie ipc;
384 struct rtable *rt = skb->rtable; 384 struct rtable *rt = skb->rtable;
385 struct net *net = rt->u.dst.dev->nd_net; 385 struct net *net = dev_net(rt->u.dst.dev);
386 struct sock *sk = icmp_sk(net); 386 struct sock *sk = icmp_sk(net);
387 struct inet_sock *inet = inet_sk(sk); 387 struct inet_sock *inet = inet_sk(sk);
388 __be32 daddr; 388 __be32 daddr;
@@ -447,7 +447,7 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
447 447
448 if (!rt) 448 if (!rt)
449 goto out; 449 goto out;
450 net = rt->u.dst.dev->nd_net; 450 net = dev_net(rt->u.dst.dev);
451 sk = icmp_sk(net); 451 sk = icmp_sk(net);
452 452
453 /* 453 /*
@@ -677,7 +677,7 @@ static void icmp_unreach(struct sk_buff *skb)
677 u32 info = 0; 677 u32 info = 0;
678 struct net *net; 678 struct net *net;
679 679
680 net = skb->dst->dev->nd_net; 680 net = dev_net(skb->dst->dev);
681 681
682 /* 682 /*
683 * Incomplete header ? 683 * Incomplete header ?