aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-07-18 03:40:17 -0400
committerDavid S. Miller <davem@davemloft.net>2011-07-18 03:40:17 -0400
commitd3aaeb38c40e5a6c08dd31a1b64da65c4352be36 (patch)
tree1c17b41d11edc7a7b3477a294cba440f2a14796c /include/net
parent69cce1d1404968f78b177a0314f5822d5afdbbfb (diff)
net: Add ->neigh_lookup() operation to dst_ops
In the future dst entries will be neigh-less. In that environment we need to have an easy transition point for current users of dst->neighbour outside of the packet output fast path. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r--include/net/arp.h9
-rw-r--r--include/net/dst.h5
-rw-r--r--include/net/dst_ops.h1
3 files changed, 6 insertions, 9 deletions
diff --git a/include/net/arp.h b/include/net/arp.h
index 5e669e6ffb42..4979af8b1559 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -38,15 +38,6 @@ static inline struct neighbour *__ipv4_neigh_lookup(struct neigh_table *tbl, str
38 return n; 38 return n;
39} 39}
40 40
41static inline struct neighbour *ipv4_neigh_lookup(struct neigh_table *tbl, struct net_device *dev, const __be32 *pkey)
42{
43 struct neighbour *n = __ipv4_neigh_lookup(tbl, dev,
44 *(__force u32 *)pkey);
45 if (n)
46 return n;
47 return neigh_create(tbl, pkey, dev);
48}
49
50extern void arp_init(void); 41extern void arp_init(void);
51extern int arp_find(unsigned char *haddr, struct sk_buff *skb); 42extern int arp_find(unsigned char *haddr, struct sk_buff *skb);
52extern int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg); 43extern int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg);
diff --git a/include/net/dst.h b/include/net/dst.h
index 8147206eefb9..29e255796ce1 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -387,6 +387,11 @@ static inline void dst_confirm(struct dst_entry *dst)
387 } 387 }
388} 388}
389 389
390static inline struct neighbour *dst_neigh_lookup(const struct dst_entry *dst, const void *daddr)
391{
392 return dst->ops->neigh_lookup(dst, daddr);
393}
394
390static inline void dst_link_failure(struct sk_buff *skb) 395static inline void dst_link_failure(struct sk_buff *skb)
391{ 396{
392 struct dst_entry *dst = skb_dst(skb); 397 struct dst_entry *dst = skb_dst(skb);
diff --git a/include/net/dst_ops.h b/include/net/dst_ops.h
index dc0746328947..9adb99845a56 100644
--- a/include/net/dst_ops.h
+++ b/include/net/dst_ops.h
@@ -26,6 +26,7 @@ struct dst_ops {
26 void (*link_failure)(struct sk_buff *); 26 void (*link_failure)(struct sk_buff *);
27 void (*update_pmtu)(struct dst_entry *dst, u32 mtu); 27 void (*update_pmtu)(struct dst_entry *dst, u32 mtu);
28 int (*local_out)(struct sk_buff *skb); 28 int (*local_out)(struct sk_buff *skb);
29 struct neighbour * (*neigh_lookup)(const struct dst_entry *dst, const void *daddr);
29 30
30 struct kmem_cache *kmem_cachep; 31 struct kmem_cache *kmem_cachep;
31 32