diff --git a/src/core/ipv4/icmp.c b/src/core/ipv4/icmp.c index c866663b..dbf7349c 100644 --- a/src/core/ipv4/icmp.c +++ b/src/core/ipv4/icmp.c @@ -380,7 +380,7 @@ icmp_send_response(struct pbuf *p, u8_t type, u8_t code) { ip4_addr_t iphdr_dst; ip4_addr_copy(iphdr_dst, iphdr->dest); - netif = ip4_route_src(&iphdr_src, &iphdr_dst); + netif = ip4_route_src(&iphdr_dst, &iphdr_src); } #else netif = ip4_route(&iphdr_src); diff --git a/src/core/udp.c b/src/core/udp.c index f7ac596c..553f6fb6 100644 --- a/src/core/udp.c +++ b/src/core/udp.c @@ -539,7 +539,7 @@ udp_sendto_chksum(struct udp_pcb *pcb, struct pbuf *p, const ip_addr_t *dst_ip, fails, we try regular routing as though no override was set. */ if (!ip4_addr_isany_val(pcb->mcast_ip4) && !ip4_addr_cmp(&pcb->mcast_ip4, IP4_ADDR_BROADCAST)) { - netif = ip4_route_src(ip_2_ip4(&pcb->local_ip), &pcb->mcast_ip4); + netif = ip4_route_src(&pcb->mcast_ip4, ip_2_ip4(&pcb->local_ip)); } } #endif /* LWIP_IPV4 */