Skip to content

Commit 6527a1b

Browse files
shrek-wangdanieldegrasse
authored andcommitted
net: tcp: Set the right th_win value in tester_prepare_tcp_pkt
The 16bit th_win in the TCP header was not set via htons(). It will bring issues of wrong th_win value in the peer end. For example, the 1280 (0x0500) TCP window size would be taken as 5 (0x0005) by the peer end. Signed-off-by: Shrek Wang <inet_eman@outlook.com>
1 parent ad4c3e3 commit 6527a1b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/net/tcp/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ static struct net_pkt *tester_prepare_tcp_pkt(sa_family_t af,
293293
}
294294

295295
th->th_flags = flags;
296-
th->th_win = NET_IPV6_MTU;
296+
th->th_win = htons(NET_IPV6_MTU);
297297
th->th_seq = htonl(seq);
298298

299299
if (ACK & flags) {

0 commit comments

Comments
 (0)