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/fib_frontend.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/fib_frontend.c')
-rw-r--r-- | net/ipv4/fib_frontend.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 86ff2711fc95..0e4b34b07cb5 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c | |||
@@ -257,7 +257,7 @@ int fib_validate_source(__be32 src, __be32 dst, u8 tos, int oif, | |||
257 | if (in_dev == NULL) | 257 | if (in_dev == NULL) |
258 | goto e_inval; | 258 | goto e_inval; |
259 | 259 | ||
260 | net = dev->nd_net; | 260 | net = dev_net(dev); |
261 | if (fib_lookup(net, &fl, &res)) | 261 | if (fib_lookup(net, &fl, &res)) |
262 | goto last_resort; | 262 | goto last_resort; |
263 | if (res.type != RTN_UNICAST) | 263 | if (res.type != RTN_UNICAST) |
@@ -674,7 +674,7 @@ out: | |||
674 | 674 | ||
675 | static void fib_magic(int cmd, int type, __be32 dst, int dst_len, struct in_ifaddr *ifa) | 675 | static void fib_magic(int cmd, int type, __be32 dst, int dst_len, struct in_ifaddr *ifa) |
676 | { | 676 | { |
677 | struct net *net = ifa->ifa_dev->dev->nd_net; | 677 | struct net *net = dev_net(ifa->ifa_dev->dev); |
678 | struct fib_table *tb; | 678 | struct fib_table *tb; |
679 | struct fib_config cfg = { | 679 | struct fib_config cfg = { |
680 | .fc_protocol = RTPROT_KERNEL, | 680 | .fc_protocol = RTPROT_KERNEL, |
@@ -801,15 +801,15 @@ static void fib_del_ifaddr(struct in_ifaddr *ifa) | |||
801 | fib_magic(RTM_DELROUTE, RTN_LOCAL, ifa->ifa_local, 32, prim); | 801 | fib_magic(RTM_DELROUTE, RTN_LOCAL, ifa->ifa_local, 32, prim); |
802 | 802 | ||
803 | /* Check, that this local address finally disappeared. */ | 803 | /* Check, that this local address finally disappeared. */ |
804 | if (inet_addr_type(dev->nd_net, ifa->ifa_local) != RTN_LOCAL) { | 804 | if (inet_addr_type(dev_net(dev), ifa->ifa_local) != RTN_LOCAL) { |
805 | /* And the last, but not the least thing. | 805 | /* And the last, but not the least thing. |
806 | We must flush stray FIB entries. | 806 | We must flush stray FIB entries. |
807 | 807 | ||
808 | First of all, we scan fib_info list searching | 808 | First of all, we scan fib_info list searching |
809 | for stray nexthop entries, then ignite fib_flush. | 809 | for stray nexthop entries, then ignite fib_flush. |
810 | */ | 810 | */ |
811 | if (fib_sync_down_addr(dev->nd_net, ifa->ifa_local)) | 811 | if (fib_sync_down_addr(dev_net(dev), ifa->ifa_local)) |
812 | fib_flush(dev->nd_net); | 812 | fib_flush(dev_net(dev)); |
813 | } | 813 | } |
814 | } | 814 | } |
815 | #undef LOCAL_OK | 815 | #undef LOCAL_OK |
@@ -899,7 +899,7 @@ static void nl_fib_lookup_exit(struct net *net) | |||
899 | static void fib_disable_ip(struct net_device *dev, int force) | 899 | static void fib_disable_ip(struct net_device *dev, int force) |
900 | { | 900 | { |
901 | if (fib_sync_down_dev(dev, force)) | 901 | if (fib_sync_down_dev(dev, force)) |
902 | fib_flush(dev->nd_net); | 902 | fib_flush(dev_net(dev)); |
903 | rt_cache_flush(0); | 903 | rt_cache_flush(0); |
904 | arp_ifdown(dev); | 904 | arp_ifdown(dev); |
905 | } | 905 | } |