Merge Official Source

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2023-03-04 16:23:17 +08:00
commit 5da18713f3
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
7 changed files with 20 additions and 31 deletions

View File

@ -137,8 +137,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+ if (!entry)
+ return false;
+
+ if (skb_headroom(skb) + 2 * ETH_ALEN < entry->hdrlen +
+ entry->fast_tx.hdr_len)
+ if (skb_headroom(skb) < entry->hdrlen + entry->fast_tx.hdr_len)
+ return false;
+
+ sta = rcu_dereference(entry->mpath->next_hop);
@ -177,6 +176,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+ if (copy_sa)
+ ether_addr_copy(meshhdr->eaddr2, sa);
+
+ skb_push(skb, 2 * ETH_ALEN);
+ __ieee80211_xmit_fast(sdata, sta, &entry->fast_tx, skb, tid_tx,
+ entry->mpath->dst, sdata->vif.addr);
+
@ -764,28 +764,20 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
{
struct ieee80211_local *local = sdata->local;
struct ieee80211_hdr *hdr = (void *)fast_tx->hdr;
@@ -3645,8 +3652,6 @@ static void __ieee80211_xmit_fast(struct
struct ieee80211_tx_data tx;
@@ -3646,7 +3653,6 @@ static void __ieee80211_xmit_fast(struct
ieee80211_tx_result r;
int hw_headroom = sdata->local->hw.extra_tx_headroom;
- int extra_head = fast_tx->hdr_len - (ETH_HLEN - 2);
int extra_head = fast_tx->hdr_len - (ETH_HLEN - 2);
- struct ethhdr eth;
skb = skb_share_check(skb, GFP_ATOMIC);
if (unlikely(!skb))
@@ -3661,16 +3666,15 @@ static void __ieee80211_xmit_fast(struct
* more room than we already have in 'extra_head'
*/
if (unlikely(ieee80211_skb_resize(sdata, skb,
- max_t(int, extra_head + hw_headroom -
+ max_t(int, fast_tx->hdr_len + hw_headroom -
skb_headroom(skb), 0),
@@ -3666,11 +3672,10 @@ static void __ieee80211_xmit_fast(struct
ENCRYPT_NO)))
goto free;
- memcpy(&eth, skb->data, ETH_HLEN - 2);
- hdr = skb_push(skb, extra_head);
+ hdr = skb_push(skb, fast_tx->hdr_len);
hdr = skb_push(skb, extra_head);
memcpy(skb->data, fast_tx->hdr, fast_tx->hdr_len);
- memcpy(skb->data + fast_tx->da_offs, eth.h_dest, ETH_ALEN);
- memcpy(skb->data + fast_tx->sa_offs, eth.h_source, ETH_ALEN);
@ -794,7 +786,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
info = IEEE80211_SKB_CB(skb);
memset(info, 0, sizeof(*info));
@@ -3689,7 +3693,8 @@ static void __ieee80211_xmit_fast(struct
@@ -3689,7 +3694,8 @@ static void __ieee80211_xmit_fast(struct
#endif
if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) {
@ -804,7 +796,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
*ieee80211_get_qos_ctl(hdr) = tid;
}
@@ -3732,6 +3737,7 @@ static bool ieee80211_xmit_fast(struct i
@@ -3732,6 +3738,7 @@ static bool ieee80211_xmit_fast(struct i
struct ieee80211_hdr *hdr = (void *)fast_tx->hdr;
struct tid_ampdu_tx *tid_tx = NULL;
struct sk_buff *next;
@ -812,17 +804,16 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
u8 tid = IEEE80211_NUM_TIDS;
/* control port protocol needs a lot of special handling */
@@ -3757,14 +3763,18 @@ static bool ieee80211_xmit_fast(struct i
@@ -3757,6 +3764,8 @@ static bool ieee80211_xmit_fast(struct i
}
}
+ memcpy(&eth, skb->data, ETH_HLEN - 2);
+
/* after this point (skb is modified) we cannot return false */
+ skb_pull(skb, ETH_HLEN - 2);
skb = ieee80211_tx_skb_fixup(skb, ieee80211_sdata_netdev_features(sdata));
if (!skb)
return true;
@@ -3764,7 +3773,8 @@ static bool ieee80211_xmit_fast(struct i
skb_list_walk_safe(skb, skb, next) {
skb_mark_not_on_list(skb);

View File

@ -64,7 +64,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
+
+ skb->dev = sdata->dev;
+ memcpy(&eth, skb->data, ETH_HLEN - 2);
+ skb_pull(skb, sizeof(eth));
+ skb_pull(skb, 2);
+ __ieee80211_xmit_fast(sdata, sta, &entry->fast_tx, skb, tid_tx,
+ eth.h_dest, eth.h_source);
+ IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_unicast);

View File

@ -13,7 +13,7 @@ Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -5970,6 +5970,18 @@ void ieee80211_queue_delayed_work(struct
@@ -5968,6 +5968,18 @@ void ieee80211_queue_delayed_work(struct
unsigned long delay);
/**

View File

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=fritz-tools
PKG_RELEASE:=1
PKG_RELEASE:=2
CMAKE_INSTALL:=1
include $(INCLUDE_DIR)/package.mk

View File

@ -210,7 +210,7 @@ int main(int argc, char **argv)
if (argc > 1 && optind <= argc) {
in = fopen(argv[optind], "r");
if (!in) {
perror("Failed to create output file");
perror("Failed to open input file");
goto out_bad;
}
}
@ -253,7 +253,9 @@ out_bad:
ret = EXIT_FAILURE;
out:
fclose(in);
fclose(out);
if (in)
fclose(in);
if (out)
fclose(out);
return ret;
}

View File

@ -8,8 +8,7 @@ include $(INCLUDE_DIR)/image.mk
KERNEL_LOADADDR = 0x80010000 # RAM start + 64K
LOADER_ENTRY = 0x80a00000 # RAM start + 10M, for relocate
RAMSIZE = 0x02000000 # 32MB
LZMA_TEXT_START = 0x81800000 # 32MB - 8MB
LZMA_TEXT_START = 0x81800000 # RAM start + 24M
RELOCATE_MAKEOPTS= \
CACHELINE_SIZE=16 \
@ -37,7 +36,6 @@ define Build/loader-lzma
KDIR=$(KDIR) \
LOADER_ADDR=$(if $(DEVICE_LOADADDR),$(DEVICE_LOADADDR),$(LOADER_ENTRY)) \
KERNEL_ADDR=$(KERNEL_LOADADDR) \
RAMSIZE=$(RAMSIZE) \
LZMA_TEXT_START=$(LZMA_TEXT_START) \
CHIP_ID=$(CHIP_ID) \
PKG_BUILD_DIR="$@.src" \

View File

@ -5,8 +5,7 @@ include $(INCLUDE_DIR)/image.mk
KERNEL_LOADADDR := 0x80010000 # RAM start + 64K
LOADER_ENTRY := 0x80a00000 # RAM start + 10M, for relocate
RAMSIZE := 0x02000000 # 32MB
LZMA_TEXT_START := 0x81800000 # 32MB - 8MB
LZMA_TEXT_START := 0x81800000 # RAM start + 24M
DEVICE_VARS += CHIP_ID DEVICE_LOADADDR
@ -32,7 +31,6 @@ define Build/loader-lzma
LOADER_NAME="$(notdir $@)" \
LZMA_TEXT_START=$(LZMA_TEXT_START) \
PKG_BUILD_DIR="$@.src" \
RAMSIZE=$(RAMSIZE) \
TARGET_DIR="$(dir $@)" \
compile loader.$(1)
@mv "$@.$(1)" "$@"