|
From: <ljs...@us...> - 2007-05-25 01:06:54
|
Revision: 404
http://svn.sourceforge.net/cadcdev/?rev=404&view=rev
Author: ljsebald
Date: 2007-05-24 18:06:52 -0700 (Thu, 24 May 2007)
Log Message:
-----------
Fixed a crashing issue in the ARP shutdown code and made the ARP code garbage collect expired entries on each lookup.
Modified Paths:
--------------
kos/kernel/net/net_arp.c
Modified: kos/kernel/net/net_arp.c
===================================================================
--- kos/kernel/net/net_arp.c 2007-05-08 00:10:41 UTC (rev 403)
+++ kos/kernel/net/net_arp.c 2007-05-25 01:06:52 UTC (rev 404)
@@ -95,6 +95,9 @@
int net_arp_lookup(netif_t *nif, uint8 ip_in[4], uint8 mac_out[6]) {
netarp_t *cur;
+ /* Garbage collect expired entries */
+ net_arp_gc();
+
/* Look for the entry */
LIST_FOREACH(cur, &net_arp_cache, ac_list) {
if (!memcmp(ip_in, cur->ip, 4)) {
@@ -140,7 +143,7 @@
return -1;
}
-/* Send an ARP reply packet on the specified network adaptor */
+/* Send an ARP reply packet on the specified network adapter */
static int net_arp_send(netif_t *nif, arp_pkt_t *pkt) {
arp_pkt_t pkt_out;
eth_hdr_t eth_hdr;
@@ -261,7 +264,7 @@
a1 = LIST_FIRST(&net_arp_cache);
while (a1 != NULL) {
a2 = LIST_NEXT(a1, ac_list);
- free(a2);
+ free(a1);
a1 = a2;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|