From: <ljs...@us...> - 2006-09-14 01:38:53
|
Revision: 351 http://svn.sourceforge.net/cadcdev/?rev=351&view=rev Author: ljsebald Date: 2006-09-13 18:38:50 -0700 (Wed, 13 Sep 2006) Log Message: ----------- Adding in a minor fix to the ARP handling code so that if an incomplete entry is encountered in the lookup code, it returns failure, rather than silently returning an invalid mac address. Modified Paths: -------------- kos/kernel/net/net_arp.c Modified: kos/kernel/net/net_arp.c =================================================================== --- kos/kernel/net/net_arp.c 2006-09-14 01:22:40 UTC (rev 350) +++ kos/kernel/net/net_arp.c 2006-09-14 01:38:50 UTC (rev 351) @@ -98,6 +98,12 @@ /* Look for the entry */ LIST_FOREACH(cur, &net_arp_cache, ac_list) { if (!memcmp(ip_in, cur->ip, 4)) { + if(cur->mac[0] == 0 && cur->mac[1] == 0 && + cur->mac[2] == 0 && cur->mac[3] == 0 && + cur->mac[4] == 0 && cur->mac[5] == 0) { + return -1; + } + memcpy(mac_out, cur->mac, 6); if (cur->timestamp != 0) cur->timestamp = jiffies; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |