e509a42
From 817a0831c54f06dda2727fe1118e7a65181eb128 Mon Sep 17 00:00:00 2001
e509a42
From: Eddie Wai <eddie.wai@broadcom.com>
e509a42
Date: Wed, 11 Dec 2013 15:38:14 -0800
e509a42
Subject: [PATCH] ISCSIUIO: Added fix for the ARP cache flush mechanism
e509a42
e509a42
The ARP cache table wasn't being flushed correctly due to a bug
e509a42
in the time stamp comparison.  The same bug can also be observed
e509a42
to find the oldest entry in the ARP cache table to override.
e509a42
e509a42
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
e509a42
---
e509a42
 iscsiuio/src/uip/uip_arp.c | 6 +++---
e509a42
 1 file changed, 3 insertions(+), 3 deletions(-)
e509a42
e509a42
diff --git a/iscsiuio/src/uip/uip_arp.c b/iscsiuio/src/uip/uip_arp.c
e509a42
index f7a9594..a8de07f 100644
e509a42
--- a/iscsiuio/src/uip/uip_arp.c
e509a42
+++ b/iscsiuio/src/uip/uip_arp.c
e509a42
@@ -112,7 +112,7 @@ void uip_arp_timer(void)
e509a42
 	for (i = 0; i < UIP_ARPTAB_SIZE; ++i) {
e509a42
 		tabptr = &arp_table[i];
e509a42
 		if ((tabptr->ipaddr[0] | tabptr->ipaddr[1]) != 0 &&
e509a42
-		    arptime - tabptr->time >= UIP_ARP_MAXAGE)
e509a42
+		    (u8_t)(arptime - tabptr->time) >= UIP_ARP_MAXAGE)
e509a42
 			memset(tabptr->ipaddr, 0, 4);
e509a42
 	}
e509a42
 
e509a42
@@ -165,8 +165,8 @@ static void uip_arp_update(u16_t *ipaddr, struct uip_eth_addr *ethaddr)
e509a42
 		c = 0;
e509a42
 		for (i = 0; i < UIP_ARPTAB_SIZE; ++i) {
e509a42
 			tabptr = &arp_table[i];
e509a42
-			if (arptime - tabptr->time > tmpage) {
e509a42
-				tmpage = arptime - tabptr->time;
e509a42
+			if ((u8_t)(arptime - tabptr->time) > tmpage) {
e509a42
+				tmpage = (u8_t)(arptime - tabptr->time);
e509a42
 				c = i;
e509a42
 			}
e509a42
 		}
e509a42
-- 
e509a42
1.8.3.1
e509a42