fixes bug #36389: Use IPv6 Src Address of Echo Response as Destination

Address in Echo Response
This commit is contained in:
Ivan Delamer 2012-05-04 17:43:54 -06:00
parent 3dcd33b08f
commit bfa28f4c30

View File

@ -158,13 +158,21 @@ icmp6_input(struct pbuf *p, struct netif *inp)
} }
/* Determine reply source IPv6 address. */ /* Determine reply source IPv6 address. */
reply_src = ip6_select_source_address(inp, ip6_current_src_addr()); #if LWIP_MULTICAST_PING
if (reply_src == NULL) { if (ip6_addr_ismulticast(ip6_current_dest_addr())) {
/* drop */ reply_src = ip6_select_source_address(inp, ip6_current_src_addr());
pbuf_free(p); if (reply_src == NULL) {
pbuf_free(r); /* drop */
ICMP6_STATS_INC(icmp6.rterr); pbuf_free(p);
return; pbuf_free(r);
ICMP6_STATS_INC(icmp6.rterr);
return;
}
}
else
#endif /* LWIP_MULTICAST_PING */
{
reply_src = ip6_current_dest_addr();
} }
/* Set fields in reply. */ /* Set fields in reply. */