From: Pasi Sjöholm <[email protected]>

If error is got from DHCP-server the operation should fail
instead of doing DAD as this can lead into a loop of
solicitation->reply->solicitation->reply...
---
 src/dhcpv6.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/dhcpv6.c b/src/dhcpv6.c
index 9249e55..d3ff127 100644
--- a/src/dhcpv6.c
+++ b/src/dhcpv6.c
@@ -1682,9 +1682,16 @@ static void solicitation_cb(GDHCPClient *dhcp_client, 
gpointer user_data)
 
        clear_timer(dhcp);
 
-       do_dad(dhcp_client, dhcp);
-
        g_dhcpv6_client_clear_retransmit(dhcp_client);
+
+       if (g_dhcpv6_client_get_status(dhcp_client) != 0) {
+               if (dhcp->callback)
+                       dhcp->callback(dhcp->network,
+                                       CONNMAN_DHCPV6_STATUS_FAIL, NULL);
+               return;
+       }
+
+       do_dad(dhcp_client, dhcp);
 }
 
 static gboolean timeout_solicitation(gpointer user_data)
-- 
2.1.0

_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to