diff options
author | Felix Fietkau <nbd@nbd.name> | 2019-09-25 14:09:45 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2019-09-25 18:16:39 +0200 |
commit | a438eac9ac98d98f594ec56ec023979be41035ca (patch) | |
tree | 2fa2938e71c1504b7fc6ebbcf7c2e3496fd63eb4 /target | |
parent | b2c55d50f8aeb21ef4cd3948034a158f7dd743c2 (diff) | |
download | upstream-a438eac9ac98d98f594ec56ec023979be41035ca.tar.gz upstream-a438eac9ac98d98f594ec56ec023979be41035ca.tar.bz2 upstream-a438eac9ac98d98f594ec56ec023979be41035ca.zip |
kernel: port another missing upstream change to xt_FLOWOFFLOAD on 4.19
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/generic/hack-4.19/650-netfilter-add-xt_OFFLOAD-target.patch | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/target/linux/generic/hack-4.19/650-netfilter-add-xt_OFFLOAD-target.patch b/target/linux/generic/hack-4.19/650-netfilter-add-xt_OFFLOAD-target.patch index bc5a5eba58..80bc1cdeff 100644 --- a/target/linux/generic/hack-4.19/650-netfilter-add-xt_OFFLOAD-target.patch +++ b/target/linux/generic/hack-4.19/650-netfilter-add-xt_OFFLOAD-target.patch @@ -98,7 +98,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> obj-$(CONFIG_NETFILTER_XT_TARGET_LED) += xt_LED.o --- /dev/null +++ b/net/netfilter/xt_FLOWOFFLOAD.c -@@ -0,0 +1,383 @@ +@@ -0,0 +1,387 @@ +/* + * Copyright (C) 2018 Felix Fietkau <nbd@nbd.name> + * @@ -344,13 +344,13 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> +flowoffload_tg(struct sk_buff *skb, const struct xt_action_param *par) +{ + const struct xt_flowoffload_target_info *info = par->targinfo; ++ struct tcphdr _tcph, *tcph = NULL; + enum ip_conntrack_info ctinfo; + enum ip_conntrack_dir dir; + struct nf_flow_route route; + struct flow_offload *flow; + struct nf_conn *ct; + struct net *net; -+ bool is_tcp = false; + + if (xt_flowoffload_skip(skb, xt_family(par))) + return XT_CONTINUE; @@ -363,7 +363,11 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> + case IPPROTO_TCP: + if (ct->proto.tcp.state != TCP_CONNTRACK_ESTABLISHED) + return XT_CONTINUE; -+ is_tcp = true; ++ ++ tcph = skb_header_pointer(skb, par->thoff, ++ sizeof(_tcph), &_tcph); ++ if (unlikely(!tcph || tcph->fin || tcph->rst)) ++ return XT_CONTINUE; + break; + case IPPROTO_UDP: + break; @@ -393,7 +397,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name> + if (!flow) + goto err_flow_alloc; + -+ if (is_tcp) { ++ if (tcph) { + ct->proto.tcp.seen[0].flags |= IP_CT_TCP_FLAG_BE_LIBERAL; + ct->proto.tcp.seen[1].flags |= IP_CT_TCP_FLAG_BE_LIBERAL; + } |