Fixing error reporting
authorJohn Hodge <[email protected]>
Sat, 20 Nov 2010 06:05:13 +0000 (14:05 +0800)
committerJohn Hodge <[email protected]>
Sat, 20 Nov 2010 06:05:13 +0000 (14:05 +0800)
Modules/IPStack/icmp.c
Modules/IPStack/ipv4.c

index 088caaa..9f67175 100644 (file)
@@ -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;
index 31d6f02..ad6c891 100644 (file)
@@ -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,

UCC git Repository :: git.ucc.asn.au