aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/route.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-07-02 05:02:15 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-05 04:02:12 -0400
commita263b3093641fb1ec377582c90986a7fd0625184 (patch)
tree691fdb4703bb88611272bf958d9de1a461f1492a /net/ipv4/route.c
parent11604721a3c4bea60e2ddd9e4e30d741ecdba7b0 (diff)
ipv4: Make neigh lookups directly in output packet path.
Do not use the dst cached neigh, we'll be getting rid of that. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r--net/ipv4/route.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 6a5afc715558..2f40363e2851 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1098,17 +1098,13 @@ static int slow_chain_length(const struct rtable *head)
1098 1098
1099static struct neighbour *ipv4_neigh_lookup(const struct dst_entry *dst, const void *daddr) 1099static struct neighbour *ipv4_neigh_lookup(const struct dst_entry *dst, const void *daddr)
1100{ 1100{
1101 static const __be32 inaddr_any = 0;
1102 struct net_device *dev = dst->dev; 1101 struct net_device *dev = dst->dev;
1103 const __be32 *pkey = daddr; 1102 const __be32 *pkey = daddr;
1104 const struct rtable *rt; 1103 const struct rtable *rt;
1105 struct neighbour *n; 1104 struct neighbour *n;
1106 1105
1107 rt = (const struct rtable *) dst; 1106 rt = (const struct rtable *) dst;
1108 1107 if (rt->rt_gateway)
1109 if (dev->flags & (IFF_LOOPBACK | IFF_POINTOPOINT))
1110 pkey = &inaddr_any;
1111 else if (rt->rt_gateway)
1112 pkey = (const __be32 *) &rt->rt_gateway; 1108 pkey = (const __be32 *) &rt->rt_gateway;
1113 1109
1114 n = __ipv4_neigh_lookup(dev, *(__force u32 *)pkey); 1110 n = __ipv4_neigh_lookup(dev, *(__force u32 *)pkey);