Blame SOURCES/open-iscsi-2.0.876-57-iscsiuio-limit-retries-of-performing-dhcpv6-before-declaring-dhcp-failure.patch

e88930
From 65bcce29d5d7ad3831513fe14c76791287847597 Mon Sep 17 00:00:00 2001
e88930
From: Nilesh Javali <nilesh.javali@cavium.com>
e88930
Date: Fri, 24 Aug 2018 06:38:45 -0400
e88930
Subject: [PATCH] iscsiuio: limit retries of performing dhcpv6 before declaring
e88930
 dhcp failure
e88930
e88930
After successful stateless router adv., the restart of handle_ndp thread
e88930
infinitely checks dhcpv6 causing IPv6 DHCP sequence failure.
e88930
Limit the retries of dhcpv6 validation.
e88930
e88930
Signed-off-by: Nilesh Javali <nilesh.javali@cavium.com>
e88930
---
e88930
 iscsiuio/src/uip/ipv6_ndpc.c | 11 ++++++++---
e88930
 1 file changed, 8 insertions(+), 3 deletions(-)
e88930
e88930
diff --git a/iscsiuio/src/uip/ipv6_ndpc.c b/iscsiuio/src/uip/ipv6_ndpc.c
e88930
index a396cb784bd3..bb07c1dd64ff 100644
e88930
--- a/iscsiuio/src/uip/ipv6_ndpc.c
e88930
+++ b/iscsiuio/src/uip/ipv6_ndpc.c
e88930
@@ -134,6 +134,7 @@ wait_rtr:
e88930
 	} while (!(ipv6c->flags & IPV6_FLAGS_ROUTER_ADV_RECEIVED));
e88930
 
e88930
 	LOG_DEBUG("%s: ndpc_handle got rtr adv", s->nic->log_name);
e88930
+	s->retry_count = 0;
e88930
 
e88930
 no_rtr_adv:
e88930
 	s->state = NDPC_STATE_RTR_ADV;
e88930
@@ -200,9 +201,13 @@ wait_dhcp:
e88930
 	} else {
e88930
 		/* Static IPv6 */
e88930
 		if (ustack->ip_config == IPV6_CONFIG_DHCP) {
e88930
-			LOG_DEBUG("%s: ndpc_handle DHCP failed",
e88930
-				  s->nic->log_name);
e88930
-			PT_RESTART(&s->pt);
e88930
+			s->retry_count++;
e88930
+			if (s->retry_count > DHCPV6_NUM_OF_RETRY) {
e88930
+				LOG_DEBUG("%s: ndpc_handle DHCP failed",
e88930
+					  s->nic->log_name);
e88930
+			} else {
e88930
+				PT_RESTART(&s->pt);
e88930
+			}
e88930
 		}
e88930
 staticv6:
e88930
 		ipv6_disable_dhcpv6(ipv6c);
e88930
-- 
e88930
2.17.2
e88930