net: tcp: replace seq/ack/wnd value shifts with system calls

In other portions of the code we use the sys_put_be* function
to shift the values from the current system endian to big
endian array of bytes.  Let's be consistent and do that in
the prepare_segment function as well.

Change-Id: I5a1a4c30ddf313c9e978be98fd969899f5de6190
Signed-off-by: Michael Scott <michael.scott@linaro.org>
This commit is contained in:
Michael Scott 2017-01-10 08:36:15 -08:00 committed by Tomasz Bursztyka
commit ff1345dbaf

View file

@ -286,17 +286,10 @@ static struct net_buf *prepare_segment(struct net_tcp *tcp,
tcphdr->src_port = src_port;
tcphdr->dst_port = dst_port;
tcphdr->seq[0] = segment->seq >> 24;
tcphdr->seq[1] = segment->seq >> 16;
tcphdr->seq[2] = segment->seq >> 8;
tcphdr->seq[3] = segment->seq;
tcphdr->ack[0] = segment->ack >> 24;
tcphdr->ack[1] = segment->ack >> 16;
tcphdr->ack[2] = segment->ack >> 8;
tcphdr->ack[3] = segment->ack;
sys_put_be32(segment->seq, tcphdr->seq);
sys_put_be32(segment->ack, tcphdr->ack);
tcphdr->flags = segment->flags;
tcphdr->wnd[0] = segment->wnd >> 8;
tcphdr->wnd[1] = segment->wnd;
sys_put_be16(segment->wnd, tcphdr->wnd);
tcphdr->urg[0] = 0;
tcphdr->urg[1] = 0;