kernel-4.19: tc_skb_protocol not defined

fixed: https://github.com/project-openwrt/openwrt-kisco/issues/48
This commit is contained in:
ElonH 2020-07-30 09:51:35 +08:00
parent 035851c019
commit 00422a78b9
No known key found for this signature in database
GPG Key ID: 5BCDD7F78A258D4C

View File

@ -336,13 +336,13 @@ Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
+ action = READ_ONCE(ca->tcf_action);
+
+ wlen = skb_network_offset(skb);
+ if (tc_skb_protocol(skb) == htons(ETH_P_IP)) {
+ if (skb_protocol(skb) == htons(ETH_P_IP)) {
+ wlen += sizeof(struct iphdr);
+ if (!pskb_may_pull(skb, wlen))
+ goto out;
+
+ proto = NFPROTO_IPV4;
+ } else if (tc_skb_protocol(skb) == htons(ETH_P_IPV6)) {
+ } else if (skb_protocol(skb) == htons(ETH_P_IPV6)) {
+ wlen += sizeof(struct ipv6hdr);
+ if (!pskb_may_pull(skb, wlen))
+ goto out;