[PATCH 1/1] net: wget: fix TCP sequence number wrap around issue

Yasuharu Shibata yasuharu.shibata at gmail.com
Mon Apr 15 15:00:13 CEST 2024


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 at gmail.com>
---
 net/wget.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/net/wget.c b/net/wget.c
index 71bac92d84..abab371e58 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);
-- 
2.25.1



More information about the U-Boot mailing list