[][MAC80211][hnat][Revert Flow offload cannot bind patch]
[Description]
Remove Flow offload cannot bind patch.
This patch might cause HNAT to learn incorrect DA on the iperf3 UDP test.
Revert "[][MAC80211][hnat][Flow offload cannot bind]"
This reverts commit 57697b616f9c8dcf8236eb94d90928bd881aacdf.
[Release-log]
N/A
Change-Id: Ifea5ccf5a9c08b1882f11addacb47eef581820d6
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/7431637
diff --git a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/9990-mt7622-backport-nf-hw-offload-framework-and-ups.patch b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/9990-mt7622-backport-nf-hw-offload-framework-and-ups.patch
index 936f979..7d4c5d6 100755
--- a/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/9990-mt7622-backport-nf-hw-offload-framework-and-ups.patch
+++ b/autobuild_mac80211_release/target/linux/mediatek/patches-5.4/9990-mt7622-backport-nf-hw-offload-framework-and-ups.patch
@@ -6122,10 +6122,10 @@
+}
diff --git a/net/netfilter/xt_FLOWOFFLOAD.c b/net/netfilter/xt_FLOWOFFLOAD.c
new file mode 100644
-index 0000000..3b6068e
+index 000000000..ae1eb2656
--- /dev/null
+++ b/net/netfilter/xt_FLOWOFFLOAD.c
-@@ -0,0 +1,786 @@
+@@ -0,0 +1,776 @@
+/*
+ * Copyright (C) 2018-2021 Felix Fietkau <nbd@nbd.name>
+ *
@@ -6493,44 +6493,34 @@
+ if (!nf_is_valid_ether_device(dev))
+ goto out;
+
-+ if (ct->status & IPS_NAT_MASK) {
-+ n = dst_neigh_lookup(dst_cache, daddr);
-+ if (!n)
-+ return -1;
++ n = dst_neigh_lookup(dst_cache, daddr);
++ if (!n)
++ return -1;
+
-+ read_lock_bh(&n->lock);
-+ nud_state = n->nud_state;
-+ ether_addr_copy(ha, n->ha);
-+ read_unlock_bh(&n->lock);
-+ neigh_release(n);
++ read_lock_bh(&n->lock);
++ nud_state = n->nud_state;
++ ether_addr_copy(ha, n->ha);
++ read_unlock_bh(&n->lock);
++ neigh_release(n);
+
-+ if (!(nud_state & NUD_VALID))
-+ return -1;
-+ }
++ if (!(nud_state & NUD_VALID))
++ return -1;
++
+out:
+ return dev_fill_forward_path(dev, ha, stack);
+}
+
-+static int nf_dev_forward_path(struct sk_buff *skb,
-+ struct nf_flow_route *route,
++static int nf_dev_forward_path(struct nf_flow_route *route,
+ const struct nf_conn *ct,
+ enum ip_conntrack_dir dir,
+ struct net_device **devs)
+{
+ const struct dst_entry *dst = route->tuple[dir].dst;
+ struct net_device_path_stack stack;
-+ struct ethhdr *eth = eth_hdr(skb);
+ struct nf_forward_info info = {};
+ unsigned char ha[ETH_ALEN];
+ int i;
+
-+ if (!(ct->status & IPS_NAT_MASK) && skb_mac_header_was_set(skb)) {
-+ if (dir == IP_CT_DIR_ORIGINAL)
-+ memcpy(ha, eth->h_dest, ETH_ALEN);
-+ else if (dir == IP_CT_DIR_REPLY)
-+ memcpy(ha, eth->h_source, ETH_ALEN);
-+ }
-+
+ if (nf_dev_fill_forward_path(route, dst, ct, dir, ha, &stack) >= 0)
+ nf_dev_path_info(&stack, &info, ha);
+
@@ -6620,9 +6610,9 @@
+
+ if (route->tuple[dir].xmit_type == FLOW_OFFLOAD_XMIT_NEIGH &&
+ route->tuple[!dir].xmit_type == FLOW_OFFLOAD_XMIT_NEIGH) {
-+ if (nf_dev_forward_path(skb, route, ct, dir, devs))
++ if (nf_dev_forward_path(route, ct, dir, devs))
+ return -1;
-+ if (nf_dev_forward_path(skb, route, ct, !dir, devs))
++ if (nf_dev_forward_path(route, ct, !dir, devs))
+ return -1;
+ }
+
@@ -6651,8 +6641,8 @@
+
+ if (route->tuple[dir].xmit_type == FLOW_OFFLOAD_XMIT_NEIGH &&
+ route->tuple[!dir].xmit_type == FLOW_OFFLOAD_XMIT_NEIGH) {
-+ if (nf_dev_forward_path(skb, route, ct, dir, devs) ||
-+ nf_dev_forward_path(skb, route, ct, !dir, devs)) {
++ if (nf_dev_forward_path(route, ct, dir, devs) ||
++ nf_dev_forward_path(route, ct, !dir, devs)) {
+ ret = -1;
+ goto err_route_dir2;
+ }