diff options
author | Amerigo Wang <amwang@redhat.com> | 2012-11-11 21:52:34 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-11-14 18:49:50 -0500 |
commit | e086cadc08e259150b2ab8f7f4a16dbf9e3c2f22 (patch) | |
tree | 38ef29e21c125dcb9f8fd75749416e4839c84469 /net/ipv4/ipip.c | |
parent | aa0010f880ab542da3ad0e72992f2dc518ac68a0 (diff) | |
download | linux-e086cadc08e259150b2ab8f7f4a16dbf9e3c2f22.tar.bz2 |
net: unify for_each_ip_tunnel_rcu()
The defitions of for_each_ip_tunnel_rcu() are same,
so unify it. Also, don't hide the parameter 't'.
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipip.c')
-rw-r--r-- | net/ipv4/ipip.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index 3a4ad7d82f67..099fc1c428b4 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c @@ -140,13 +140,6 @@ static void ipip_tunnel_setup(struct net_device *dev); static void ipip_dev_free(struct net_device *dev); static struct rtnl_link_ops ipip_link_ops __read_mostly; -/* - * Locking : hash tables are protected by RCU and RTNL - */ - -#define for_each_ip_tunnel_rcu(start) \ - for (t = rcu_dereference(start); t; t = rcu_dereference(t->next)) - static struct rtnl_link_stats64 *ipip_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *tot) { @@ -189,16 +182,16 @@ static struct ip_tunnel *ipip_tunnel_lookup(struct net *net, struct ip_tunnel *t; struct ipip_net *ipn = net_generic(net, ipip_net_id); - for_each_ip_tunnel_rcu(ipn->tunnels_r_l[h0 ^ h1]) + for_each_ip_tunnel_rcu(t, ipn->tunnels_r_l[h0 ^ h1]) if (local == t->parms.iph.saddr && remote == t->parms.iph.daddr && (t->dev->flags&IFF_UP)) return t; - for_each_ip_tunnel_rcu(ipn->tunnels_r[h0]) + for_each_ip_tunnel_rcu(t, ipn->tunnels_r[h0]) if (remote == t->parms.iph.daddr && (t->dev->flags&IFF_UP)) return t; - for_each_ip_tunnel_rcu(ipn->tunnels_l[h1]) + for_each_ip_tunnel_rcu(t, ipn->tunnels_l[h1]) if (local == t->parms.iph.saddr && (t->dev->flags&IFF_UP)) return t; |