diff options
author | Jozsef Kadlecsik <kadlec@netfilter.org> | 2020-11-19 13:50:02 +0100 |
---|---|---|
committer | Jozsef Kadlecsik <kadlec@netfilter.org> | 2020-11-19 13:50:02 +0100 |
commit | c965c9770b0a8c49375fdf47c544bc2bb3c3bce6 (patch) | |
tree | 75c08cf5ba28a4c897e23efbc516d2f949edb4f9 /kernel | |
parent | 8f1af2e9fe86f3c9ca2925855d1622d7e7b2b708 (diff) |
Compatibility: use skb_policy() from if_vlan.h if available
Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/include/linux/netfilter/ipset/ip_set_compat.h.in | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in index 0bcff2c..cc61baf 100644 --- a/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in +++ b/kernel/include/linux/netfilter/ipset/ip_set_compat.h.in @@ -57,6 +57,7 @@ #@HAVE_COND_RESCHED_RCU@ HAVE_COND_RESCHED_RCU #@HAVE_SKB_IIF@ HAVE_SKB_IIF #@HAVE_LIST_FOR_EACH_ENTRY_RCU_FOUR_ARGS@ HAVE_LIST_FOR_EACH_ENTRY_RCU_FOUR_ARGS +#@HAVE_SKB_PROTOCOL@ HAVE_SKB_PROTOCOL #ifdef HAVE_EXPORT_SYMBOL_GPL_IN_MODULE_H #include <linux/module.h> @@ -372,6 +373,9 @@ static inline int nla_put_in6_addr(struct sk_buff *skb, int attrtype, static inline __be16 tc_skb_protocol(const struct sk_buff *skb) { +#ifdef HAVE_SKB_PROTOCOL + return skb_protocol(skb, true); +#else if (skb_vlan_tag_present(skb)) #ifdef HAVE_VLAN_PROTO_IN_SK_BUFF return skb->vlan_proto; @@ -379,6 +383,7 @@ static inline __be16 tc_skb_protocol(const struct sk_buff *skb) return htons(ETH_P_8021Q); #endif return skb->protocol; +#endif } #endif |