From e72a71a53db531b87eed3cddf0a4bb8331afc873 Mon Sep 17 00:00:00 2001 From: Leyi Rong Date: Fri, 5 Aug 2016 23:54:38 +0800 Subject: [PATCH] net: uip: Fix uip_udp_conns traverse loop in uip_process the traverse step length should be sizeof(struct uip_udp_conn) in uip_process when matching the right uip_udp_conn for net_buf Change-Id: I33c0499582a96e5031ba94f147ff2376726b3f9c Signed-off-by: Leyi Rong --- net/ip/contiki/ipv4/uip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ip/contiki/ipv4/uip.c b/net/ip/contiki/ipv4/uip.c index 126463ee8ee..7a1e311bb78 100644 --- a/net/ip/contiki/ipv4/uip.c +++ b/net/ip/contiki/ipv4/uip.c @@ -1249,7 +1249,7 @@ uip_process(struct net_buf **buf_out, uint8_t flag) /* Demultiplex this UDP packet between the UDP "connections". */ for(i = 0, uip_set_udp_conn(buf) = &uip_udp_conns[0]; i < UIP_UDP_CONNS && uip_udp_conn(buf) < &uip_udp_conns[UIP_UDP_CONNS]; - i++, ++uip_set_udp_conn(buf)) { + i++, uip_set_udp_conn(buf) += sizeof(struct uip_udp_conn)) { /* If the local UDP port is non-zero, the connection is considered to be used. If so, the local port number is checked against the destination port number in the received packet. If the two port