aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_ipv4.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/tcp_ipv4.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/tcp_ipv4.c')
-rw-r--r--net/ipv4/tcp_ipv4.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 649d00a50cb1..28bece6f281b 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -353,7 +353,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info)
353 return; 353 return;
354 } 354 }
355 355
356 sk = inet_lookup(skb->dev->nd_net, &tcp_hashinfo, iph->daddr, th->dest, 356 sk = inet_lookup(dev_net(skb->dev), &tcp_hashinfo, iph->daddr, th->dest,
357 iph->saddr, th->source, inet_iif(skb)); 357 iph->saddr, th->source, inet_iif(skb));
358 if (!sk) { 358 if (!sk) {
359 ICMP_INC_STATS_BH(ICMP_MIB_INERRORS); 359 ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
@@ -1644,7 +1644,7 @@ int tcp_v4_rcv(struct sk_buff *skb)
1644 TCP_SKB_CB(skb)->flags = iph->tos; 1644 TCP_SKB_CB(skb)->flags = iph->tos;
1645 TCP_SKB_CB(skb)->sacked = 0; 1645 TCP_SKB_CB(skb)->sacked = 0;
1646 1646
1647 sk = __inet_lookup(skb->dev->nd_net, &tcp_hashinfo, iph->saddr, 1647 sk = __inet_lookup(dev_net(skb->dev), &tcp_hashinfo, iph->saddr,
1648 th->source, iph->daddr, th->dest, inet_iif(skb)); 1648 th->source, iph->daddr, th->dest, inet_iif(skb));
1649 if (!sk) 1649 if (!sk)
1650 goto no_tcp_socket; 1650 goto no_tcp_socket;
@@ -1718,7 +1718,7 @@ do_time_wait:
1718 } 1718 }
1719 switch (tcp_timewait_state_process(inet_twsk(sk), skb, th)) { 1719 switch (tcp_timewait_state_process(inet_twsk(sk), skb, th)) {
1720 case TCP_TW_SYN: { 1720 case TCP_TW_SYN: {
1721 struct sock *sk2 = inet_lookup_listener(skb->dev->nd_net, 1721 struct sock *sk2 = inet_lookup_listener(dev_net(skb->dev),
1722 &tcp_hashinfo, 1722 &tcp_hashinfo,
1723 iph->daddr, th->dest, 1723 iph->daddr, th->dest,
1724 inet_iif(skb)); 1724 inet_iif(skb));