From: John Hodge Date: Sat, 20 Nov 2010 06:05:13 +0000 (+0800) Subject: Fixing error reporting X-Git-Tag: rel0.07~55 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=3866eea678c951b063ecb66673b4f6afd8c19abe;p=tpg%2Facess2.git Fixing error reporting --- diff --git a/Modules/IPStack/icmp.c b/Modules/IPStack/icmp.c index 088caaaf..9f671752 100644 --- a/Modules/IPStack/icmp.c +++ b/Modules/IPStack/icmp.c @@ -125,8 +125,7 @@ int ICMP_Ping(tInterface *Interface, tIPv4 Addr) end = ts + Interface->TimeoutDelay; while( !gICMP_PingSlots[i].bArrived && now() < end) Threads_Yield(); - ts = now() - ts; - if(ts > Interface->TimeoutDelay) + if(now() > end) return -1; return (int)ts; diff --git a/Modules/IPStack/ipv4.c b/Modules/IPStack/ipv4.c index 31d6f027..ad6c891a 100644 --- a/Modules/IPStack/ipv4.c +++ b/Modules/IPStack/ipv4.c @@ -64,11 +64,16 @@ int IPv4_RegisterCallback(int ID, tIPCallback Callback) int IPv4_SendPacket(tInterface *Iface, tIPv4 Address, int Protocol, int ID, int Length, const void *Data) { tMacAddr to = ARP_Resolve4(Iface, Address); + const tMacAddr zero = {{0,0,0,0,0,0}}; int bufSize = sizeof(tIPv4Header) + Length; char buf[bufSize]; tIPv4Header *hdr = (void*)buf; int ret; + if( MAC_EQU(to, zero) ) { + return 0; + } + // OUTPUT Firewall rule go here ret = IPTablesV4_TestChain("OUTPUT", (tIPv4*)Iface->Address, &Address,