From 99d6ff0d81984dc1e39280a6dc775612a66001d1 Mon Sep 17 00:00:00 2001 From: Simon Brummer Date: Fri, 24 Jan 2020 13:44:44 +0100 Subject: [PATCH] SQUASH_ME: gnrc_tcp: fix failing static tests --- sys/include/net/gnrc/tcp.h | 2 +- sys/net/gnrc/transport_layer/tcp/gnrc_tcp.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/include/net/gnrc/tcp.h b/sys/include/net/gnrc/tcp.h index cf3c91da4492..493264d119b8 100644 --- a/sys/include/net/gnrc/tcp.h +++ b/sys/include/net/gnrc/tcp.h @@ -124,7 +124,7 @@ int gnrc_tcp_open_active(gnrc_tcp_tcb_t *tcb, const gnrc_tcp_ep_t *remote, * * @param[in,out] tcb TCB holding the connection information. * @param[in] local Endpoint specifying the port and address used to wait for - * incomming connections. + * incoming connections. * * @returns 0 on success. * @returns -EAFNOSUPPORT if local_addr != NULL and @p address_family is not supported. diff --git a/sys/net/gnrc/transport_layer/tcp/gnrc_tcp.c b/sys/net/gnrc/transport_layer/tcp/gnrc_tcp.c index b4712e37bfa9..3167de488297 100644 --- a/sys/net/gnrc/transport_layer/tcp/gnrc_tcp.c +++ b/sys/net/gnrc/transport_layer/tcp/gnrc_tcp.c @@ -165,9 +165,11 @@ static int _gnrc_tcp_open(gnrc_tcp_tcb_t *tcb, const gnrc_tcp_ep_t *remote, } /* Setup active connection */ else { + assert(remote != NULL); + /* Parse target address and port number into TCB */ #ifdef MODULE_GNRC_IPV6 - if ((remote != NULL) && (tcb->address_family == AF_INET6)) { + if (tcb->address_family == AF_INET6) { /* Store Address information in TCB */ if (memcpy(tcb->peer_addr, remote->addr.ipv6, sizeof(tcb->peer_addr)) == NULL) { @@ -177,6 +179,7 @@ static int _gnrc_tcp_open(gnrc_tcp_tcb_t *tcb, const gnrc_tcp_ep_t *remote, tcb->ll_iface = remote->netif; } #endif + /* Assign port numbers, verification happens in fsm */ tcb->local_port = local_port; tcb->peer_port = remote->port;