+ timeout = now() + Interface->TimeoutDelay;
+
+ // Wait for a reply
+ for(;;)
+ {
+ while(lastID == giARP_LastUpdateID && now() < timeout) {
+ Threads_Yield();
+ }
+
+ if( now() >= timeout ) {
+ Log_Log("ARP4", "Timeout");
+ break; // Timeout
+ }
+
+ lastID = giARP_LastUpdateID;
+
+ Mutex_Acquire( &glARP_Cache4 );
+ for( i = 0; i < giARP_Cache4Space; i++ )
+ {
+ if(gaARP_Cache4[i].IP.L != Address.L) continue;
+
+ Mutex_Release( &glARP_Cache4 );
+ Log_Debug("ARP4", "Return %02x:%02x:%02x:%02x:%02x:%02x",
+ gaARP_Cache4[i].MAC.B[0], gaARP_Cache4[i].MAC.B[1],
+ gaARP_Cache4[i].MAC.B[2], gaARP_Cache4[i].MAC.B[3],
+ gaARP_Cache4[i].MAC.B[4], gaARP_Cache4[i].MAC.B[5]);
+ return gaARP_Cache4[i].MAC;
+ }
+ Mutex_Release( &glARP_Cache4 );
+ }
+ {
+ tMacAddr ret = {{0,0,0,0,0,0}};
+ return ret;
+ }