diff options
| author | Tom Herbert <therbert@google.com> | 2013-12-16 01:16:29 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2013-12-17 16:36:22 -0500 |
| commit | 3df7a74e797aa2d8be9b7c649cfd56a8517dcf6e (patch) | |
| tree | 5d5e556692e3c945517319e812520286905a4af6 | |
| parent | 09323cc479316e046931a2c679932204b36fea6c (diff) | |
net: Add utility function to copy skb hash
Adds skb_copy_hash to copy rxhash and l4_rxhash from one skb to another.
Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
| -rw-r--r-- | include/linux/skbuff.h | 6 | ||||
| -rw-r--r-- | net/core/skbuff.c | 3 |
2 files changed, 7 insertions, 2 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 99846956dff9..06bedeb0d49e 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -764,6 +764,12 @@ static inline void skb_clear_hash_if_not_l4(struct sk_buff *skb) | |||
| 764 | skb_clear_hash(skb); | 764 | skb_clear_hash(skb); |
| 765 | } | 765 | } |
| 766 | 766 | ||
| 767 | static inline void skb_copy_hash(struct sk_buff *to, const struct sk_buff *from) | ||
| 768 | { | ||
| 769 | to->rxhash = from->rxhash; | ||
| 770 | to->l4_rxhash = from->l4_rxhash; | ||
| 771 | }; | ||
| 772 | |||
| 767 | #ifdef NET_SKBUFF_DATA_USES_OFFSET | 773 | #ifdef NET_SKBUFF_DATA_USES_OFFSET |
| 768 | static inline unsigned char *skb_end_pointer(const struct sk_buff *skb) | 774 | static inline unsigned char *skb_end_pointer(const struct sk_buff *skb) |
| 769 | { | 775 | { |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 06e72d3cdf60..2b6b863f51f2 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
| @@ -712,9 +712,8 @@ static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old) | |||
| 712 | new->inner_network_header = old->inner_network_header; | 712 | new->inner_network_header = old->inner_network_header; |
| 713 | new->inner_mac_header = old->inner_mac_header; | 713 | new->inner_mac_header = old->inner_mac_header; |
| 714 | skb_dst_copy(new, old); | 714 | skb_dst_copy(new, old); |
| 715 | new->rxhash = old->rxhash; | 715 | skb_copy_hash(new, old); |
| 716 | new->ooo_okay = old->ooo_okay; | 716 | new->ooo_okay = old->ooo_okay; |
| 717 | new->l4_rxhash = old->l4_rxhash; | ||
| 718 | new->no_fcs = old->no_fcs; | 717 | new->no_fcs = old->no_fcs; |
| 719 | new->encapsulation = old->encapsulation; | 718 | new->encapsulation = old->encapsulation; |
| 720 | #ifdef CONFIG_XFRM | 719 | #ifdef CONFIG_XFRM |
