git-svn-id: https://spexeah.com:8443/svn/Asuro@689 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c

This commit is contained in:
kieron
2018-05-10 11:02:51 +00:00
parent 80c31e9a0b
commit 865ffbc739
12 changed files with 16 additions and 12 deletions

View File

@ -34,11 +34,13 @@ var
begin
push_trace('arp.findCacheRecordByMAC');
findCacheRecordByMAC:= nil;
for i:=0 to LL_Size(Cache)-1 do begin
r:= PARPCacheRecord(LL_Get(Cache, i));
if MACEqual(mac, @r^.MAC[0]) then begin
findCacheRecordByMAC:= r;
break;
if LL_Size(Cache) > 0 then begin
for i:=0 to LL_Size(Cache)-1 do begin
r:= PARPCacheRecord(LL_Get(Cache, i));
if MACEqual(mac, @r^.MAC[0]) then begin
findCacheRecordByMAC:= r;
break;
end;
end;
end;
pop_trace;
@ -52,11 +54,13 @@ var
begin
push_trace('arp.findCacheRecordByIP');
findCacheRecordByIP:= nil;
for i:=0 to LL_Size(Cache)-1 do begin
r:= PARPCacheRecord(LL_Get(Cache, i));
if IPEqual(ip, @r^.IP[0]) then begin
findCacheRecordByIP:= r;
break;
if LL_Size(Cache) > 0 then begin
for i:=0 to LL_Size(Cache)-1 do begin
r:= PARPCacheRecord(LL_Get(Cache, i));
if IPEqual(ip, @r^.IP[0]) then begin
findCacheRecordByIP:= r;
break;
end;
end;
end;
pop_trace;