aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorTom Herbert <therbert@google.com>2013-12-16 01:12:18 -0500
committerDavid S. Miller <davem@davemloft.net>2013-12-17 16:36:21 -0500
commit7539fadcb8146a5f0db51e80d99c9e724efec7b0 (patch)
tree7d3563c2240b16402d536162b4f49bdf036b91ed /net/ipv4
parent3958afa1b272eb07109fd31549e69193b4d7c364 (diff)
net: Add utility functions to clear rxhash
In several places 'skb->rxhash = 0' is being done to clear the rxhash value in an skb. This does not clear l4_rxhash which could still be set so that the rxhash wouldn't be recalculated on subsequent call to skb_get_rxhash. This patch adds an explict function to clear all the rxhash related information in the skb properly. skb_clear_hash_if_not_l4 clears the rxhash only if it is not marked as l4_rxhash. Fixed up places where 'skb->rxhash = 0' was being called. Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/ip_fragment.c2
-rw-r--r--net/ipv4/ip_tunnel_core.c5
2 files changed, 3 insertions, 4 deletions
diff --git a/net/ipv4/ip_fragment.c b/net/ipv4/ip_fragment.c
index 2481993a4970..c10a3ce5cbff 100644
--- a/net/ipv4/ip_fragment.c
+++ b/net/ipv4/ip_fragment.c
@@ -704,7 +704,7 @@ struct sk_buff *ip_check_defrag(struct sk_buff *skb, u32 user)
704 memset(IPCB(skb), 0, sizeof(struct inet_skb_parm)); 704 memset(IPCB(skb), 0, sizeof(struct inet_skb_parm));
705 if (ip_defrag(skb, user)) 705 if (ip_defrag(skb, user))
706 return NULL; 706 return NULL;
707 skb->rxhash = 0; 707 skb_clear_hash(skb);
708 } 708 }
709 } 709 }
710 return skb; 710 return skb;
diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c
index 42ffbc8d65c6..6156f4ef5e91 100644
--- a/net/ipv4/ip_tunnel_core.c
+++ b/net/ipv4/ip_tunnel_core.c
@@ -56,7 +56,7 @@ int iptunnel_xmit(struct rtable *rt, struct sk_buff *skb,
56 56
57 skb_scrub_packet(skb, xnet); 57 skb_scrub_packet(skb, xnet);
58 58
59 skb->rxhash = 0; 59 skb_clear_hash(skb);
60 skb_dst_set(skb, &rt->dst); 60 skb_dst_set(skb, &rt->dst);
61 memset(IPCB(skb), 0, sizeof(*IPCB(skb))); 61 memset(IPCB(skb), 0, sizeof(*IPCB(skb)));
62 62
@@ -107,8 +107,7 @@ int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto)
107 107
108 nf_reset(skb); 108 nf_reset(skb);
109 secpath_reset(skb); 109 secpath_reset(skb);
110 if (!skb->l4_rxhash) 110 skb_clear_hash_if_not_l4(skb);
111 skb->rxhash = 0;
112 skb_dst_drop(skb); 111 skb_dst_drop(skb);
113 skb->vlan_tci = 0; 112 skb->vlan_tci = 0;
114 skb_set_queue_mapping(skb, 0); 113 skb_set_queue_mapping(skb, 0);