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

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