From dc7a9c8c370c0e34580414de4eb00c5fb868a6ac Mon Sep 17 00:00:00 2001 From: Our Air Quality Date: Mon, 4 Sep 2017 07:26:15 +1000 Subject: [PATCH] tcp_in: correct some loops continuing without maintaining a prev pointer. This problem would appear to have only affected systems with multiple interfaces. It was noted causing tcp resets when the pcb was lost, and there might have been other associated problems. Signed-off-by: Dirk Ziegelmeier --- src/core/tcp_in.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/tcp_in.c b/src/core/tcp_in.c index c15a4099..747a0181 100644 --- a/src/core/tcp_in.c +++ b/src/core/tcp_in.c @@ -247,6 +247,7 @@ tcp_input(struct pbuf *p, struct netif *inp) /* check if PCB is bound to specific netif */ if ((pcb->netif_idx != NETIF_NO_INDEX) && (pcb->netif_idx != netif_get_index(ip_data.current_input_netif))) { + prev = pcb; continue; } @@ -304,6 +305,7 @@ tcp_input(struct pbuf *p, struct netif *inp) /* check if PCB is bound to specific netif */ if ((lpcb->netif_idx != NETIF_NO_INDEX) && (lpcb->netif_idx != netif_get_index(ip_data.current_input_netif))) { + prev = (struct tcp_pcb *)lpcb; continue; } @@ -327,7 +329,7 @@ tcp_input(struct pbuf *p, struct netif *inp) lpcb_prev = prev; #else /* SO_REUSE */ break; - #endif /* SO_REUSE */ +#endif /* SO_REUSE */ } } }