X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=sidebyside;f=Modules%2FIPStack%2Farp.c;h=1e5bb07389d760b427540499e1268b86376a3efa;hb=b1873b4cff47aae8ada8cc303ea01b475cc7ccc8;hp=82382635872475bec621a4f8d7fc8cb5dec58a90;hpb=23096bbffa94688e90db5045d124dcdfe83a132e;p=tpg%2Facess2.git diff --git a/Modules/IPStack/arp.c b/Modules/IPStack/arp.c index 82382635..1e5bb073 100644 --- a/Modules/IPStack/arp.c +++ b/Modules/IPStack/arp.c @@ -81,13 +81,12 @@ tMacAddr ARP_Resolve4(tInterface *Interface, tIPv4 Address) if( IPStack_CompareAddress(4, &Address, Interface->Address, Interface->SubnetBits) == 0 ) { tRoute *route = IPStack_FindRoute(4, Interface, &Address); - if( route ) { - // If the next hop is defined, use it - // - 0.0.0.0 as the next hop means "no next hop / direct" - if( ((tIPv4*)route->NextHop)->L != 0 ) { - // Recursion: see /Recursion/ - return ARP_Resolve4(Interface, *(tIPv4*)route->NextHop); - } + // If the next hop is defined, use it + // - 0.0.0.0 as the next hop means "no next hop / direct" + if( route && ((tIPv4*)route->NextHop)->L != 0 ) + { + // Recursion: see /Recursion/ + return ARP_Resolve4(Interface, *(tIPv4*)route->NextHop); } }