summaryrefslogtreecommitdiffstats
path: root/net/packet
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-03-25 21:47:49 +0900
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-03-26 04:39:53 +0900
commitc346dca10840a874240c78efe3f39acf4312a1f2 (patch)
treec04cff20124eba5cc337cc5ec260ad2513eeb065 /net/packet
parent7cbca67c073263c179f605bdbbdc565ab29d801d (diff)
downloadlinux-stable-c346dca10840a874240c78efe3f39acf4312a1f2.tar.gz
linux-stable-c346dca10840a874240c78efe3f39acf4312a1f2.tar.bz2
linux-stable-c346dca10840a874240c78efe3f39acf4312a1f2.zip
[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/packet')
-rw-r--r--net/packet/af_packet.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index a56ed2120e07..baa290d3444a 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -263,7 +263,7 @@ static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev, struct
if (skb->pkt_type == PACKET_LOOPBACK)
goto out;
- if (dev->nd_net != sk->sk_net)
+ if (dev_net(dev) != sk->sk_net)
goto out;
if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL)
@@ -451,7 +451,7 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev, struct packet
sk = pt->af_packet_priv;
po = pkt_sk(sk);
- if (dev->nd_net != sk->sk_net)
+ if (dev_net(dev) != sk->sk_net)
goto drop;
skb->dev = dev;
@@ -568,7 +568,7 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, struct packe
sk = pt->af_packet_priv;
po = pkt_sk(sk);
- if (dev->nd_net != sk->sk_net)
+ if (dev_net(dev) != sk->sk_net)
goto drop;
if (dev->header_ops) {
@@ -1450,7 +1450,7 @@ static int packet_notifier(struct notifier_block *this, unsigned long msg, void
struct sock *sk;
struct hlist_node *node;
struct net_device *dev = data;
- struct net *net = dev->nd_net;
+ struct net *net = dev_net(dev);
read_lock(&net->packet.sklist_lock);
sk_for_each(sk, node, &net->packet.sklist) {