]> git.ipfire.org Git - thirdparty/ipset.git/commitdiff
compatibility: move to skb_protocol in the code from tc_skb_protocol
authorJozsef Kadlecsik <kadlec@netfilter.org>
Mon, 7 Nov 2022 20:50:05 +0000 (21:50 +0100)
committerJozsef Kadlecsik <kadlec@netfilter.org>
Mon, 7 Nov 2022 20:50:05 +0000 (21:50 +0100)
And fix a typo committed by me in em_sched.c too.

kernel/include/linux/netfilter/ipset/ip_set_compat.h.in
kernel/net/sched/em_ipset.c

index 4d2c446b104e69a9feeee0c98f63fe540470e1f6..6a4b071df23dd2876b51aa1d2a205418b0d75b91 100644 (file)
@@ -406,11 +406,9 @@ static inline int nla_put_in6_addr(struct sk_buff *skb, int attrtype,
 #define skb_vlan_tag_present vlan_tx_tag_present
 #endif
 
-static inline __be16 tc_skb_protocol(const struct sk_buff *skb)
+#ifndef HAVE_SKB_PROTOCOL
+static inline __be16 skb_protocol(const struct sk_buff *skb, bool skip_vlan)
 {
-#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;
@@ -418,9 +416,9 @@ static inline __be16 tc_skb_protocol(const struct sk_buff *skb)
                return htons(ETH_P_8021Q);
 #endif
        return skb->protocol;
-#endif
 }
 #endif
+#endif
 
 #ifdef HAVE_XT_NET
 #define IPSET_DEV_NET(par)     xt_net(par)
index 4f7184a13eeeed48ebffa2be3aa5ed5aef39bac4..5428f8d0eb9ebf8ae082cff8d1f90fbfaf6e83ee 100644 (file)
@@ -84,7 +84,7 @@ static int em_ipset_match(struct sk_buff *skb, struct tcf_ematch *em,
 #else
 #define ACPAR_FAMILY(f)                acpar.family = f
 #endif
-       switch (skb_protocol((skb, true)) {
+       switch (skb_protocol(skb, true)) {
        case htons(ETH_P_IP):
                ACPAR_FAMILY(NFPROTO_IPV4);
                if (!pskb_network_may_pull(skb, sizeof(struct iphdr)))