瀏覽代碼

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
Simon Goldschmidt 2 年之前
父節點
當前提交
d8b97bfc5d
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/core/ipv4/icmp.c

+ 1 - 0
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 */