summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorTom Herbert <tom@herbertland.com>2015-09-01 09:24:33 -0700
committerDavid S. Miller <davem@davemloft.net>2015-09-01 15:06:23 -0700
commit6db61d79c1e1b2346e2142d6c950a8d2e8380b82 (patch)
treeaf5886ed49d500ad34a2d0a8d69e92c6d3cf84fe /net
parent823b96939578eae67b9d6c0e33a39d6a7b6401e7 (diff)
downloadblackbird-obmc-linux-6db61d79c1e1b2346e2142d6c950a8d2e8380b82.tar.gz
blackbird-obmc-linux-6db61d79c1e1b2346e2142d6c950a8d2e8380b82.zip
flow_dissector: Ignore flow dissector return value from ___skb_get_hash
In ___skb_get_hash ignore return value from skb_flow_dissect_flow_keys. A failure in that function likely means that there was a parse error, so we may as well use whatever fields were found before the error was hit. This is also good because it means we won't keep trying to derive the hash on subsequent calls to skb_get_hash for the same packet. Signed-off-by: Tom Herbert <tom@herbertland.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/flow_dissector.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 8d890132e2d7..b563339436d0 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -616,9 +616,8 @@ EXPORT_SYMBOL(flow_hash_from_keys);
static inline u32 ___skb_get_hash(const struct sk_buff *skb,
struct flow_keys *keys, u32 keyval)
{
- if (!skb_flow_dissect_flow_keys(skb, keys,
- FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL))
- return 0;
+ skb_flow_dissect_flow_keys(skb, keys,
+ FLOW_DISSECTOR_F_STOP_AT_FLOW_LABEL);
return __flow_hash_from_keys(keys, keyval);
}
@@ -662,15 +661,10 @@ EXPORT_SYMBOL(make_flow_keys_digest);
void __skb_get_hash(struct sk_buff *skb)
{
struct flow_keys keys;
- u32 hash;
__flow_hash_secret_init();
- hash = ___skb_get_hash(skb, &keys, hashrnd);
- if (!hash)
- return;
-
- __skb_set_sw_hash(skb, hash,
+ __skb_set_sw_hash(skb, ___skb_get_hash(skb, &keys, hashrnd),
flow_keys_have_l4(&keys));
}
EXPORT_SYMBOL(__skb_get_hash);
OpenPOWER on IntegriCloud