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 <leyi.rong@intel.com>
This commit is contained in:
Leyi Rong 2016-08-05 23:54:38 +08:00 committed by Inaky Perez-Gonzalez
commit e72a71a53d

View file

@ -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