aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/neighbour.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/neighbour.h')
-rw-r--r--include/net/neighbour.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index c8aacbd2e333..3725b93c52f3 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -160,7 +160,7 @@ struct neigh_table
160 atomic_t entries; 160 atomic_t entries;
161 rwlock_t lock; 161 rwlock_t lock;
162 unsigned long last_rand; 162 unsigned long last_rand;
163 kmem_cache_t *kmem_cachep; 163 struct kmem_cache *kmem_cachep;
164 struct neigh_statistics *stats; 164 struct neigh_statistics *stats;
165 struct neighbour **hash_buckets; 165 struct neighbour **hash_buckets;
166 unsigned int hash_mask; 166 unsigned int hash_mask;
@@ -309,6 +309,24 @@ static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
309 return 0; 309 return 0;
310} 310}
311 311
312static inline int neigh_hh_output(struct hh_cache *hh, struct sk_buff *skb)
313{
314 unsigned seq;
315 int hh_len;
316
317 do {
318 int hh_alen;
319
320 seq = read_seqbegin(&hh->hh_lock);
321 hh_len = hh->hh_len;
322 hh_alen = HH_DATA_ALIGN(hh_len);
323 memcpy(skb->data - hh_alen, hh->hh_data, hh_alen);
324 } while (read_seqretry(&hh->hh_lock, seq));
325
326 skb_push(skb, hh_len);
327 return hh->hh_output(skb);
328}
329
312static inline struct neighbour * 330static inline struct neighbour *
313__neigh_lookup(struct neigh_table *tbl, const void *pkey, struct net_device *dev, int creat) 331__neigh_lookup(struct neigh_table *tbl, const void *pkey, struct net_device *dev, int creat)
314{ 332{