Commit 74c3b9a3 authored by Andy Ross's avatar Andy Ross Committed by Jukka Rissanen
Browse files

net: tcp: Fix uninitialized garbage in TCP urgent field



Per spec, this is required to be zero when URG is unset, but we were
never initializing it.  It seems benign AFAICT, but produces warnings
in wireshark.

Change-Id: Ie4e28070e32767aabc60c63bb85287c1215ebb0d
Signed-off-by: default avatarAndy Ross <andrew.j.ross@intel.com>
Signed-off-by: default avatarLeandro Pereira <leandro.pereira@intel.com>
parent e5a5f1da
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -589,7 +589,7 @@ static inline int send_control_segment(struct net_context *context,
				       const struct sockaddr *remote,
				       int flags, const char *msg)
{
	struct net_buf *buf;
	struct net_buf *buf = NULL;
	int ret;

	ret = net_tcp_prepare_segment(context->tcp, flags,
@@ -640,7 +640,7 @@ static inline int send_fin_ack(struct net_context *context,
static inline int send_ack(struct net_context *context,
			   struct sockaddr *remote)
{
	struct net_buf *buf;
	struct net_buf *buf = NULL;
	int ret;

	ret = net_tcp_prepare_ack(context->tcp, remote, &buf);
@@ -661,7 +661,7 @@ static inline int send_ack(struct net_context *context,
static int send_reset(struct net_context *context,
		      struct sockaddr *remote)
{
	struct net_buf *buf;
	struct net_buf *buf = NULL;
	int ret;

	ret = net_tcp_prepare_reset(context->tcp, remote, &buf);
+2 −0
Original line number Diff line number Diff line
@@ -253,6 +253,8 @@ static struct net_buf *prepare_segment(struct net_tcp *tcp,
	tcphdr->flags = segment->flags;
	tcphdr->wnd[0] = segment->wnd >> 8;
	tcphdr->wnd[1] = segment->wnd;
	tcphdr->urg[0] = 0;
	tcphdr->urg[1] = 0;

	if (tail) {
		net_buf_frag_add(buf, tail);