diff options
Diffstat (limited to 'include/net/neighbour.h')
-rw-r--r-- | include/net/neighbour.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 344d8988842a..0dab173e27da 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -334,18 +334,22 @@ static inline int neigh_hh_bridge(struct hh_cache *hh, struct sk_buff *skb) | |||
334 | } | 334 | } |
335 | #endif | 335 | #endif |
336 | 336 | ||
337 | static inline int neigh_hh_output(struct hh_cache *hh, struct sk_buff *skb) | 337 | static inline int neigh_hh_output(const struct hh_cache *hh, struct sk_buff *skb) |
338 | { | 338 | { |
339 | unsigned int seq; | 339 | unsigned int seq; |
340 | int hh_len; | 340 | int hh_len; |
341 | 341 | ||
342 | do { | 342 | do { |
343 | int hh_alen; | ||
344 | |||
345 | seq = read_seqbegin(&hh->hh_lock); | 343 | seq = read_seqbegin(&hh->hh_lock); |
346 | hh_len = hh->hh_len; | 344 | hh_len = hh->hh_len; |
347 | hh_alen = HH_DATA_ALIGN(hh_len); | 345 | if (likely(hh_len <= HH_DATA_MOD)) { |
348 | memcpy(skb->data - hh_alen, hh->hh_data, hh_alen); | 346 | /* this is inlined by gcc */ |
347 | memcpy(skb->data - HH_DATA_MOD, hh->hh_data, HH_DATA_MOD); | ||
348 | } else { | ||
349 | int hh_alen = HH_DATA_ALIGN(hh_len); | ||
350 | |||
351 | memcpy(skb->data - hh_alen, hh->hh_data, hh_alen); | ||
352 | } | ||
349 | } while (read_seqretry(&hh->hh_lock, seq)); | 353 | } while (read_seqretry(&hh->hh_lock, seq)); |
350 | 354 | ||
351 | skb_push(skb, hh_len); | 355 | skb_push(skb, hh_len); |