aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.h
diff options
context:
space:
mode:
authorSander Vanheule <sander@svanheule.net>2022-06-19 10:29:35 +0200
committerSander Vanheule <sander@svanheule.net>2022-07-21 20:59:51 +0200
commit396dc89ee74c833ba3f687b586a1718c13f17900 (patch)
treeef98ccc167c8c8d686f0432db113fb6a04cb56ae /target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.h
parentf8a44c22d469049edb9593322cd4111e7ea40b9b (diff)
downloadupstream-396dc89ee74c833ba3f687b586a1718c13f17900.tar.gz
upstream-396dc89ee74c833ba3f687b586a1718c13f17900.tar.bz2
upstream-396dc89ee74c833ba3f687b586a1718c13f17900.zip
realtek: correct egress frame port verification
Destination switch ports for outgoing frame can range from 0 to CPU_PORT-1. Refactor the code to only generate egress frame CPU headers when a valid destination port number is available, and make the code a bit more consistent between different switch generations. Change the dest_port argument's type to 'unsigned int', since only positive values are valid. This fixes the issue where egress frames on switch port 0 did not receive a VLAN tag, because they are sent out without a CPU header. Also fixes a potential issue with invalid (negative) egress port numbers on RTL93xx switches. Reported-by: Arınç ÜNAL <arinc.unal@xeront.com> Suggested-by: Birger Koblitz <mail@birger-koblitz.de> Tested-by: Luiz Angelo Daros de Luca <luizluca@gmail.com> Signed-off-by: Sander Vanheule <sander@svanheule.net> (cherry picked from commit 1773264a0c6da099af7f36046f95f0126d6de1eb)
Diffstat (limited to 'target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.h')
-rw-r--r--target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.h b/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.h
index 2d1f80dc9d..5db5f545b9 100644
--- a/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.h
+++ b/target/linux/realtek/files-5.10/drivers/net/ethernet/rtl838x_eth.h
@@ -436,7 +436,7 @@ struct rtl838x_eth_reg {
int mac;
int l2_tbl_flush_ctrl;
void (*update_cntr)(int r, int work_done);
- void (*create_tx_header)(struct p_hdr *h, int dest_port, int prio);
+ void (*create_tx_header)(struct p_hdr *h, unsigned int dest_port, int prio);
bool (*decode_tag)(struct p_hdr *h, struct dsa_tag *tag);
};