Skip to content

Commit

Permalink
icmp: fix bug #64211 (ICMP reply error when using bridge)
Browse files Browse the repository at this point in the history
when reusing an rx pbuf for tx, its if_idx has to be reset or else bridgeif_send_to_port() might drop it
  • Loading branch information
goldsimon committed Sep 27, 2023
1 parent f7fe057 commit d8b97bf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/core/ipv4/icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit d8b97bf

Please sign in to comment.