diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-25 08:47:49 -0400 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-25 15:39:53 -0400 |
commit | c346dca10840a874240c78efe3f39acf4312a1f2 (patch) | |
tree | c04cff20124eba5cc337cc5ec260ad2513eeb065 /net/ipv4/igmp.c | |
parent | 7cbca67c073263c179f605bdbbdc565ab29d801d (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/igmp.c')
-rw-r--r-- | net/ipv4/igmp.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 6a4ee8da6994..682f632bfb77 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -130,12 +130,12 @@ | |||
130 | */ | 130 | */ |
131 | 131 | ||
132 | #define IGMP_V1_SEEN(in_dev) \ | 132 | #define IGMP_V1_SEEN(in_dev) \ |
133 | (IPV4_DEVCONF_ALL(in_dev->dev->nd_net, FORCE_IGMP_VERSION) == 1 || \ | 133 | (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), FORCE_IGMP_VERSION) == 1 || \ |
134 | IN_DEV_CONF_GET((in_dev), FORCE_IGMP_VERSION) == 1 || \ | 134 | IN_DEV_CONF_GET((in_dev), FORCE_IGMP_VERSION) == 1 || \ |
135 | ((in_dev)->mr_v1_seen && \ | 135 | ((in_dev)->mr_v1_seen && \ |
136 | time_before(jiffies, (in_dev)->mr_v1_seen))) | 136 | time_before(jiffies, (in_dev)->mr_v1_seen))) |
137 | #define IGMP_V2_SEEN(in_dev) \ | 137 | #define IGMP_V2_SEEN(in_dev) \ |
138 | (IPV4_DEVCONF_ALL(in_dev->dev->nd_net, FORCE_IGMP_VERSION) == 2 || \ | 138 | (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), FORCE_IGMP_VERSION) == 2 || \ |
139 | IN_DEV_CONF_GET((in_dev), FORCE_IGMP_VERSION) == 2 || \ | 139 | IN_DEV_CONF_GET((in_dev), FORCE_IGMP_VERSION) == 2 || \ |
140 | ((in_dev)->mr_v2_seen && \ | 140 | ((in_dev)->mr_v2_seen && \ |
141 | time_before(jiffies, (in_dev)->mr_v2_seen))) | 141 | time_before(jiffies, (in_dev)->mr_v2_seen))) |
@@ -1198,7 +1198,7 @@ void ip_mc_inc_group(struct in_device *in_dev, __be32 addr) | |||
1198 | 1198 | ||
1199 | ASSERT_RTNL(); | 1199 | ASSERT_RTNL(); |
1200 | 1200 | ||
1201 | if (in_dev->dev->nd_net != &init_net) | 1201 | if (dev_net(in_dev->dev) != &init_net) |
1202 | return; | 1202 | return; |
1203 | 1203 | ||
1204 | for (im=in_dev->mc_list; im; im=im->next) { | 1204 | for (im=in_dev->mc_list; im; im=im->next) { |
@@ -1280,7 +1280,7 @@ void ip_mc_dec_group(struct in_device *in_dev, __be32 addr) | |||
1280 | 1280 | ||
1281 | ASSERT_RTNL(); | 1281 | ASSERT_RTNL(); |
1282 | 1282 | ||
1283 | if (in_dev->dev->nd_net != &init_net) | 1283 | if (dev_net(in_dev->dev) != &init_net) |
1284 | return; | 1284 | return; |
1285 | 1285 | ||
1286 | for (ip=&in_dev->mc_list; (i=*ip)!=NULL; ip=&i->next) { | 1286 | for (ip=&in_dev->mc_list; (i=*ip)!=NULL; ip=&i->next) { |
@@ -1310,7 +1310,7 @@ void ip_mc_down(struct in_device *in_dev) | |||
1310 | 1310 | ||
1311 | ASSERT_RTNL(); | 1311 | ASSERT_RTNL(); |
1312 | 1312 | ||
1313 | if (in_dev->dev->nd_net != &init_net) | 1313 | if (dev_net(in_dev->dev) != &init_net) |
1314 | return; | 1314 | return; |
1315 | 1315 | ||
1316 | for (i=in_dev->mc_list; i; i=i->next) | 1316 | for (i=in_dev->mc_list; i; i=i->next) |
@@ -1333,7 +1333,7 @@ void ip_mc_init_dev(struct in_device *in_dev) | |||
1333 | { | 1333 | { |
1334 | ASSERT_RTNL(); | 1334 | ASSERT_RTNL(); |
1335 | 1335 | ||
1336 | if (in_dev->dev->nd_net != &init_net) | 1336 | if (dev_net(in_dev->dev) != &init_net) |
1337 | return; | 1337 | return; |
1338 | 1338 | ||
1339 | in_dev->mc_tomb = NULL; | 1339 | in_dev->mc_tomb = NULL; |
@@ -1359,7 +1359,7 @@ void ip_mc_up(struct in_device *in_dev) | |||
1359 | 1359 | ||
1360 | ASSERT_RTNL(); | 1360 | ASSERT_RTNL(); |
1361 | 1361 | ||
1362 | if (in_dev->dev->nd_net != &init_net) | 1362 | if (dev_net(in_dev->dev) != &init_net) |
1363 | return; | 1363 | return; |
1364 | 1364 | ||
1365 | ip_mc_inc_group(in_dev, IGMP_ALL_HOSTS); | 1365 | ip_mc_inc_group(in_dev, IGMP_ALL_HOSTS); |
@@ -1378,7 +1378,7 @@ void ip_mc_destroy_dev(struct in_device *in_dev) | |||
1378 | 1378 | ||
1379 | ASSERT_RTNL(); | 1379 | ASSERT_RTNL(); |
1380 | 1380 | ||
1381 | if (in_dev->dev->nd_net != &init_net) | 1381 | if (dev_net(in_dev->dev) != &init_net) |
1382 | return; | 1382 | return; |
1383 | 1383 | ||
1384 | /* Deactivate timers */ | 1384 | /* Deactivate timers */ |