diff options
author | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-25 14:57:35 -0400 |
---|---|---|
committer | YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> | 2008-03-25 15:40:00 -0400 |
commit | 878628fbf2589eb24357e42027d5f54b1dafd3c8 (patch) | |
tree | 30c109d8f337b3910e3b5364877c3c521dd700b5 /net/ipv4/route.c | |
parent | 57da52c1e62c6c13875e97de6c69d3156f8416da (diff) |
[NET] NETNS: Omit namespace comparision without CONFIG_NET_NS.
Introduce an inline net_eq() to compare two namespaces.
Without CONFIG_NET_NS, since no namespace other than &init_net
exists, it is always 1.
We do not need to convert 1) inline vs inline and
2) inline vs &init_net comparisons.
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r-- | net/ipv4/route.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index eab8d75e5222..230716c2dfe0 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -1196,7 +1196,7 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw, | |||
1196 | rth->fl.oif != ikeys[k] || | 1196 | rth->fl.oif != ikeys[k] || |
1197 | rth->fl.iif != 0 || | 1197 | rth->fl.iif != 0 || |
1198 | rth->rt_genid != atomic_read(&rt_genid) || | 1198 | rth->rt_genid != atomic_read(&rt_genid) || |
1199 | dev_net(rth->u.dst.dev) != net) { | 1199 | !net_eq(dev_net(rth->u.dst.dev), net)) { |
1200 | rthp = &rth->u.dst.rt_next; | 1200 | rthp = &rth->u.dst.rt_next; |
1201 | continue; | 1201 | continue; |
1202 | } | 1202 | } |
@@ -1455,7 +1455,7 @@ unsigned short ip_rt_frag_needed(struct net *net, struct iphdr *iph, | |||
1455 | rth->rt_src == iph->saddr && | 1455 | rth->rt_src == iph->saddr && |
1456 | rth->fl.iif == 0 && | 1456 | rth->fl.iif == 0 && |
1457 | !(dst_metric_locked(&rth->u.dst, RTAX_MTU)) && | 1457 | !(dst_metric_locked(&rth->u.dst, RTAX_MTU)) && |
1458 | dev_net(rth->u.dst.dev) == net && | 1458 | net_eq(dev_net(rth->u.dst.dev), net) && |
1459 | rth->rt_genid == atomic_read(&rt_genid)) { | 1459 | rth->rt_genid == atomic_read(&rt_genid)) { |
1460 | unsigned short mtu = new_mtu; | 1460 | unsigned short mtu = new_mtu; |
1461 | 1461 | ||
@@ -2085,7 +2085,7 @@ int ip_route_input(struct sk_buff *skb, __be32 daddr, __be32 saddr, | |||
2085 | rth->fl.oif == 0 && | 2085 | rth->fl.oif == 0 && |
2086 | rth->fl.mark == skb->mark && | 2086 | rth->fl.mark == skb->mark && |
2087 | rth->fl.fl4_tos == tos && | 2087 | rth->fl.fl4_tos == tos && |
2088 | dev_net(rth->u.dst.dev) == net && | 2088 | net_eq(dev_net(rth->u.dst.dev), net) && |
2089 | rth->rt_genid == atomic_read(&rt_genid)) { | 2089 | rth->rt_genid == atomic_read(&rt_genid)) { |
2090 | dst_use(&rth->u.dst, jiffies); | 2090 | dst_use(&rth->u.dst, jiffies); |
2091 | RT_CACHE_STAT_INC(in_hit); | 2091 | RT_CACHE_STAT_INC(in_hit); |
@@ -2487,7 +2487,7 @@ int __ip_route_output_key(struct net *net, struct rtable **rp, | |||
2487 | rth->fl.mark == flp->mark && | 2487 | rth->fl.mark == flp->mark && |
2488 | !((rth->fl.fl4_tos ^ flp->fl4_tos) & | 2488 | !((rth->fl.fl4_tos ^ flp->fl4_tos) & |
2489 | (IPTOS_RT_MASK | RTO_ONLINK)) && | 2489 | (IPTOS_RT_MASK | RTO_ONLINK)) && |
2490 | dev_net(rth->u.dst.dev) == net && | 2490 | net_eq(dev_net(rth->u.dst.dev), net) && |
2491 | rth->rt_genid == atomic_read(&rt_genid)) { | 2491 | rth->rt_genid == atomic_read(&rt_genid)) { |
2492 | dst_use(&rth->u.dst, jiffies); | 2492 | dst_use(&rth->u.dst, jiffies); |
2493 | RT_CACHE_STAT_INC(out_hit); | 2493 | RT_CACHE_STAT_INC(out_hit); |
@@ -2796,7 +2796,7 @@ int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb) | |||
2796 | rcu_read_lock_bh(); | 2796 | rcu_read_lock_bh(); |
2797 | for (rt = rcu_dereference(rt_hash_table[h].chain), idx = 0; rt; | 2797 | for (rt = rcu_dereference(rt_hash_table[h].chain), idx = 0; rt; |
2798 | rt = rcu_dereference(rt->u.dst.rt_next), idx++) { | 2798 | rt = rcu_dereference(rt->u.dst.rt_next), idx++) { |
2799 | if (dev_net(rt->u.dst.dev) != net || idx < s_idx) | 2799 | if (!net_eq(dev_net(rt->u.dst.dev), net) || idx < s_idx) |
2800 | continue; | 2800 | continue; |
2801 | if (rt->rt_genid != atomic_read(&rt_genid)) | 2801 | if (rt->rt_genid != atomic_read(&rt_genid)) |
2802 | continue; | 2802 | continue; |