int lastID;
int i;
struct sArpRequest4 req;
+ Sint64 timeout;
ENTER("pInterface xAddress", Interface, Address);
- // Check routing tables
+ // Check routing tables if not on this subnet
+ if( IPStack_CompareAddress(4, &Address, Interface->Address, Interface->SubnetBits) == 0 )
{
tRoute *route = IPStack_FindRoute(4, Interface, &Address);
if( route ) {
// Send Request
Link_SendPacket(Interface->Adapter, 0x0806, req.DestMac, sizeof(struct sArpRequest4), &req);
+ timeout = now() + Interface->TimeoutDelay;
+
// Wait for a reply
for(;;)
{
- while(lastID == giARP_LastUpdateID) Threads_Yield();
+ while(lastID == giARP_LastUpdateID && now() < timeout)
+ Threads_Yield();
+
+ if( now() >= timeout ) break; // Timeout
+
lastID = giARP_LastUpdateID;
Mutex_Acquire( &glARP_Cache4 );
}
Mutex_Release( &glARP_Cache4 );
}
+ {
+ tMacAddr ret = {{0,0,0,0,0,0}};
+ return ret;
+ }
}
/**