fixed icmp_send_response with LWIP_HOOK_IP4_ROUTE_SRC enabled

This commit is contained in:
sg 2016-03-05 15:57:40 +01:00
parent bcab7fef84
commit b00a17059a

View File

@ -360,7 +360,15 @@ icmp_send_response(struct pbuf *p, u8_t type, u8_t code)
IP_HLEN + ICMP_DEST_UNREACH_DATASIZE);
ip4_addr_copy(iphdr_src, iphdr->src);
#ifdef LWIP_HOOK_IP4_ROUTE_SRC
{
ip4_addr_t iphdr_dst;
ip4_addr_copy(iphdr_dst, iphdr->dest);
netif = ip4_route_src(&iphdr_src, &iphdr_dst);
}
#else
netif = ip4_route(&iphdr_src);
#endif
if (netif != NULL) {
/* calculate checksum */
icmphdr->chksum = 0;