diff options
author | Tom Herbert <therbert@google.com> | 2013-12-16 01:12:18 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-12-17 16:36:21 -0500 |
commit | 7539fadcb8146a5f0db51e80d99c9e724efec7b0 (patch) | |
tree | 7d3563c2240b16402d536162b4f49bdf036b91ed /net/openvswitch/actions.c | |
parent | 3958afa1b272eb07109fd31549e69193b4d7c364 (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/openvswitch/actions.c')
-rw-r--r-- | net/openvswitch/actions.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c index 65cfaa816075..716b7eebfe70 100644 --- a/net/openvswitch/actions.c +++ b/net/openvswitch/actions.c | |||
@@ -165,7 +165,7 @@ static void set_ip_addr(struct sk_buff *skb, struct iphdr *nh, | |||
165 | } | 165 | } |
166 | 166 | ||
167 | csum_replace4(&nh->check, *addr, new_addr); | 167 | csum_replace4(&nh->check, *addr, new_addr); |
168 | skb->rxhash = 0; | 168 | skb_clear_hash(skb); |
169 | *addr = new_addr; | 169 | *addr = new_addr; |
170 | } | 170 | } |
171 | 171 | ||
@@ -199,7 +199,7 @@ static void set_ipv6_addr(struct sk_buff *skb, u8 l4_proto, | |||
199 | if (recalculate_csum) | 199 | if (recalculate_csum) |
200 | update_ipv6_checksum(skb, l4_proto, addr, new_addr); | 200 | update_ipv6_checksum(skb, l4_proto, addr, new_addr); |
201 | 201 | ||
202 | skb->rxhash = 0; | 202 | skb_clear_hash(skb); |
203 | memcpy(addr, new_addr, sizeof(__be32[4])); | 203 | memcpy(addr, new_addr, sizeof(__be32[4])); |
204 | } | 204 | } |
205 | 205 | ||
@@ -296,7 +296,7 @@ static void set_tp_port(struct sk_buff *skb, __be16 *port, | |||
296 | { | 296 | { |
297 | inet_proto_csum_replace2(check, skb, *port, new_port, 0); | 297 | inet_proto_csum_replace2(check, skb, *port, new_port, 0); |
298 | *port = new_port; | 298 | *port = new_port; |
299 | skb->rxhash = 0; | 299 | skb_clear_hash(skb); |
300 | } | 300 | } |
301 | 301 | ||
302 | static void set_udp_port(struct sk_buff *skb, __be16 *port, __be16 new_port) | 302 | static void set_udp_port(struct sk_buff *skb, __be16 *port, __be16 new_port) |
@@ -310,7 +310,7 @@ static void set_udp_port(struct sk_buff *skb, __be16 *port, __be16 new_port) | |||
310 | uh->check = CSUM_MANGLED_0; | 310 | uh->check = CSUM_MANGLED_0; |
311 | } else { | 311 | } else { |
312 | *port = new_port; | 312 | *port = new_port; |
313 | skb->rxhash = 0; | 313 | skb_clear_hash(skb); |
314 | } | 314 | } |
315 | } | 315 | } |
316 | 316 | ||
@@ -381,7 +381,7 @@ static int set_sctp(struct sk_buff *skb, | |||
381 | /* Carry any checksum errors through. */ | 381 | /* Carry any checksum errors through. */ |
382 | sh->checksum = old_csum ^ old_correct_csum ^ new_csum; | 382 | sh->checksum = old_csum ^ old_correct_csum ^ new_csum; |
383 | 383 | ||
384 | skb->rxhash = 0; | 384 | skb_clear_hash(skb); |
385 | } | 385 | } |
386 | 386 | ||
387 | return 0; | 387 | return 0; |