From d8b97bfc5d34d6b049ccbe2e05ebc99205643e85 Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Wed, 27 Sep 2023 21:49:24 +0200 Subject: [PATCH] icmp: fix bug #64211 (ICMP reply error when using bridge) when reusing an rx pbuf for tx, its if_idx has to be reset or else bridgeif_send_to_port() might drop it --- src/core/ipv4/icmp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/ipv4/icmp.c b/src/core/ipv4/icmp.c index 9a82a67a..f35ff4b5 100644 --- a/src/core/ipv4/icmp.c +++ b/src/core/ipv4/icmp.c @@ -213,6 +213,7 @@ icmp_input(struct pbuf *p, struct netif *inp) ip4_addr_copy(iphdr->src, *src); ip4_addr_copy(iphdr->dest, *ip4_current_src_addr()); ICMPH_TYPE_SET(iecho, ICMP_ER); + p->if_idx = NETIF_NO_INDEX; /* we're reusing this pbuf, so reset its if_idx */ #if CHECKSUM_GEN_ICMP IF__NETIF_CHECKSUM_ENABLED(inp, NETIF_CHECKSUM_GEN_ICMP) { /* adjust the checksum */