git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed GUI font rendering
[tpg/acess2.git]
/
Modules
/
IPStack
/
arp.c
diff --git
a/Modules/IPStack/arp.c
b/Modules/IPStack/arp.c
index
9e92414
..
35532f6
100644
(file)
--- a/
Modules/IPStack/arp.c
+++ b/
Modules/IPStack/arp.c
@@
-73,10
+73,12
@@
tMacAddr ARP_Resolve4(tInterface *Interface, tIPv4 Address)
int lastID;
int i;
struct sArpRequest4 req;
int lastID;
int i;
struct sArpRequest4 req;
+ Sint64 timeout;
ENTER("pInterface xAddress", Interface, Address);
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 ) {
{
tRoute *route = IPStack_FindRoute(4, Interface, &Address);
if( route ) {
@@
-128,10
+130,16
@@
tMacAddr ARP_Resolve4(tInterface *Interface, tIPv4 Address)
// Send Request
Link_SendPacket(Interface->Adapter, 0x0806, req.DestMac, sizeof(struct sArpRequest4), &req);
// Send Request
Link_SendPacket(Interface->Adapter, 0x0806, req.DestMac, sizeof(struct sArpRequest4), &req);
+ timeout = now() + Interface->TimeoutDelay;
+
// Wait for a reply
for(;;)
{
// 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 );
lastID = giARP_LastUpdateID;
Mutex_Acquire( &glARP_Cache4 );
@@
-144,6
+152,10
@@
tMacAddr ARP_Resolve4(tInterface *Interface, tIPv4 Address)
}
Mutex_Release( &glARP_Cache4 );
}
}
Mutex_Release( &glARP_Cache4 );
}
+ {
+ tMacAddr ret = {{0,0,0,0,0,0}};
+ return ret;
+ }
}
/**
}
/**
UCC
git Repository :: git.ucc.asn.au