Skip to content

Commit d364d50

Browse files
committed
Improve MIP resiliency
1 parent 615d324 commit d364d50

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

mip/mip.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ static struct ip *tx_ip(struct mip_if *ifp, uint8_t proto, uint32_t ip_src,
297297
if (!mac && ((ip_dst & ifp->mask) == (ifp->ip & ifp->mask)))
298298
arp_ask(ifp, ip_dst); // Same net, lookup
299299
if (!mac) mac = arp_cache_find(ifp, ifp->gw); // Use gateway MAC
300+
if (!mac) arp_ask(ifp, ifp->gw); // Not found? lookup
300301
if (mac) memcpy(eth->dst, mac, sizeof(eth->dst)); // Found? Use it
301302
if (!mac) memset(eth->dst, 255, sizeof(eth->dst)); // No? Use broadcast
302303
memcpy(eth->src, ifp->mac, sizeof(eth->src)); // TODO(cpq): ARP lookup

mongoose.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6824,6 +6824,7 @@ static struct ip *tx_ip(struct mip_if *ifp, uint8_t proto, uint32_t ip_src,
68246824
if (!mac && ((ip_dst & ifp->mask) == (ifp->ip & ifp->mask)))
68256825
arp_ask(ifp, ip_dst); // Same net, lookup
68266826
if (!mac) mac = arp_cache_find(ifp, ifp->gw); // Use gateway MAC
6827+
if (!mac) arp_ask(ifp, ifp->gw); // Not found? lookup
68276828
if (mac) memcpy(eth->dst, mac, sizeof(eth->dst)); // Found? Use it
68286829
if (!mac) memset(eth->dst, 255, sizeof(eth->dst)); // No? Use broadcast
68296830
memcpy(eth->src, ifp->mac, sizeof(eth->src)); // TODO(cpq): ARP lookup

0 commit comments

Comments
 (0)