From 99513f188911b4972dc0688df03366d0bfa6e743 Mon Sep 17 00:00:00 2001 From: George Oikonomou Date: Mon, 27 Oct 2014 18:53:54 +0000 Subject: [PATCH 1/2] Fill IPv6->Next-Hdr field for outgoing RSTs --- core/net/ipv6/uip6.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/net/ipv6/uip6.c b/core/net/ipv6/uip6.c index 15c2dd7d0..2debd54d7 100644 --- a/core/net/ipv6/uip6.c +++ b/core/net/ipv6/uip6.c @@ -2239,8 +2239,6 @@ uip_process(uint8_t flag) UIP_TCP_BUF->seqno[2] = uip_connr->snd_nxt[2]; UIP_TCP_BUF->seqno[3] = uip_connr->snd_nxt[3]; - UIP_IP_BUF->proto = UIP_PROTO_TCP; - UIP_TCP_BUF->srcport = uip_connr->lport; UIP_TCP_BUF->destport = uip_connr->rport; @@ -2262,6 +2260,8 @@ uip_process(uint8_t flag) } tcp_send_noconn: + UIP_IP_BUF->proto = UIP_PROTO_TCP; + UIP_IP_BUF->ttl = uip_ds6_if.cur_hop_limit; UIP_IP_BUF->len[0] = ((uip_len - UIP_IPH_LEN) >> 8); UIP_IP_BUF->len[1] = ((uip_len - UIP_IPH_LEN) & 0xff); From ffc27061fe84c40378bfc314de846f229deea1a9 Mon Sep 17 00:00:00 2001 From: Adam Dunkels Date: Tue, 9 Dec 2014 08:10:03 +0100 Subject: [PATCH 2/2] Correctly set the proto field for the case when tcp_send_noconn is called without tcp_send being called --- core/net/ipv4/uip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/net/ipv4/uip.c b/core/net/ipv4/uip.c index d27287f38..f1bb7257a 100644 --- a/core/net/ipv4/uip.c +++ b/core/net/ipv4/uip.c @@ -1875,8 +1875,6 @@ uip_process(uint8_t flag) BUF->seqno[2] = uip_connr->snd_nxt[2]; BUF->seqno[3] = uip_connr->snd_nxt[3]; - BUF->proto = UIP_PROTO_TCP; - BUF->srcport = uip_connr->lport; BUF->destport = uip_connr->rport; @@ -1893,6 +1891,8 @@ uip_process(uint8_t flag) } tcp_send_noconn: + BUF->proto = UIP_PROTO_TCP; + BUF->ttl = UIP_TTL; #if NETSTACK_CONF_WITH_IPV6 /* For IPv6, the IP length field does not include the IPv6 IP header