summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2016-07-03 17:56:53 +0200
committerFelix Fietkau <nbd@nbd.name>2016-07-03 17:56:53 +0200
commitb1748321597097d73b1806f096f9e4049a53b0ad (patch)
treeabd69a30dde69d19f7cece46c20f9342667a18a7 /package
parent70afc0bdd1fb0474b864998f7674316a00954715 (diff)
downloadmtk-20170518-b1748321597097d73b1806f096f9e4049a53b0ad.zip
mtk-20170518-b1748321597097d73b1806f096f9e4049a53b0ad.tar.gz
mtk-20170518-b1748321597097d73b1806f096f9e4049a53b0ad.tar.bz2
mac80211: backport skb_get_hash_perturb() for 4.1 and older
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package')
-rw-r--r--package/kernel/mac80211/patches/005-backport_skb_get_hash_perturb.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/005-backport_skb_get_hash_perturb.patch b/package/kernel/mac80211/patches/005-backport_skb_get_hash_perturb.patch
new file mode 100644
index 0000000..8212910
--- /dev/null
+++ b/package/kernel/mac80211/patches/005-backport_skb_get_hash_perturb.patch
@@ -0,0 +1,28 @@
+--- a/backport-include/linux/skbuff.h
++++ b/backport-include/linux/skbuff.h
+@@ -1,6 +1,8 @@
+ #ifndef __BACKPORT_SKBUFF_H
+ #define __BACKPORT_SKBUFF_H
+ #include_next <linux/skbuff.h>
++#include <net/flow_keys.h>
++#include <linux/jhash.h>
+ #include <linux/version.h>
+ #include <generated/utsrelease.h>
+
+@@ -305,6 +307,16 @@ static inline void skb_free_frag(void *d
+ {
+ put_page(virt_to_head_page(data));
+ }
++
++static inline u32 skb_get_hash_perturb(struct sk_buff *skb, u32 key)
++{
++ struct flow_keys keys;
++
++ skb_flow_dissect(skb, &keys);
++ return jhash_3words((__force u32)keys.dst,
++ (__force u32)keys.src ^ keys.ip_proto,
++ (__force u32)keys.ports, key);
++}
+ #endif
+
+ #endif /* __BACKPORT_SKBUFF_H */