aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasuharu Shibata <yasuharu.shibata@gmail.com>2024-04-16 09:26:24 +0900
committerTom Rini <trini@konsulko.com>2024-04-16 17:19:35 -0600
commitbeac9581531d7882df8c1de653db18fb3ab4100a (patch)
tree78ce10cf4b44f1f19ddaab65929022be12a89d9c
parentcab7867cff33f9c21025102ea9ca3b26e362fb52 (diff)
downloadu-boot-beac9581531d7882df8c1de653db18fb3ab4100a.zip
u-boot-beac9581531d7882df8c1de653db18fb3ab4100a.tar.gz
u-boot-beac9581531d7882df8c1de653db18fb3ab4100a.tar.bz2
net: wget: fix TCP sequence number wrap around issueWIP/16Apr2024
If tcp_seq_num is wrap around, tcp_seq_num >= initial_data_seq_num isn't satisfied and store_block() isn't called. The condition has a wrap around issue, so it is fixed in this patch. Signed-off-by: Yasuharu Shibata <yasuharu.shibata@gmail.com> Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com> Suggested-by: Michael Trimarchi <michael@amarulasolutions.com> Reported-by: Tim Harvey <tharvey@gateworks.com> Tested-by: Fabio Estevam <festevam@denx.de>
-rw-r--r--net/wget.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/wget.c b/net/wget.c
index 71bac92..abab371 100644
--- a/net/wget.c
+++ b/net/wget.c
@@ -404,9 +404,7 @@ static void wget_handler(uchar *pkt, u16 dport,
}
next_data_seq_num = tcp_seq_num + len;
- if (tcp_seq_num >= initial_data_seq_num &&
- store_block(pkt, tcp_seq_num - initial_data_seq_num,
- len) != 0) {
+ if (store_block(pkt, tcp_seq_num - initial_data_seq_num, len) != 0) {
wget_fail("wget: store error\n",
tcp_seq_num, tcp_ack_num, action);
net_set_state(NETLOOP_FAIL);