net: tcp: Store MSS in tcp header correctly
Use UNALIGNED_PUT() to store the MSS value into network packet because the memory location cannot be guaranteed to be properly aligned. Change-Id: I77fd7a70ef45eedb657cac29457b0239b0a1d4c2 Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
deea71b3c6
commit
7a07f23da7
1 changed files with 3 additions and 2 deletions
|
@ -521,8 +521,9 @@ static void net_tcp_set_syn_opt(struct net_tcp *tcp, uint8_t *options,
|
|||
recv_mss = 0;
|
||||
}
|
||||
|
||||
*((uint32_t *)(options + *optionlen)) =
|
||||
htonl((uint32_t)(recv_mss | NET_TCP_MSS_HEADER));
|
||||
UNALIGNED_PUT(htonl((uint32_t)recv_mss | NET_TCP_MSS_HEADER),
|
||||
(uint32_t *)(options + *optionlen));
|
||||
|
||||
*optionlen += NET_TCP_MSS_SIZE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue