Blame SOURCES/0061-ISCSIUIO-Added-fix-for-the-ARP-cache-flush-mechanism.patch

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