From ea435fc085c16ebd3d40521d362ad0ccddfbad48 Mon Sep 17 00:00:00 2001 From: Saurav Babu Date: Tue, 1 Mar 2016 17:10:31 +0530 Subject: gdhcp: Don't send DHCPREQUEST if last assigned IP is Link Local Address In the following scenario: 1. ConnMan is connected to a service and Link Local Address is obtained. 2. Disconnect the service. 3. Connect the service again. ConnMan tries to send DHCPREQUEST with last assigned IP which was Link Local Address. This patch makes ConnMan to send DHCPDISCOVER when last assigned IP was Link Local Address. Change-Id: I3c03f2b43a0f5c5f3be0a4878decb4345af55b33 Signed-off-by: Saurav Babu --- gdhcp/client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gdhcp') diff --git a/gdhcp/client.c b/gdhcp/client.c index b4b3e7ee..81896136 100755 --- a/gdhcp/client.c +++ b/gdhcp/client.c @@ -2770,7 +2770,8 @@ int g_dhcp_client_start(GDHCPClient *dhcp_client, const char *last_address) addr = 0; } else { addr = ntohl(inet_addr(last_address)); - if (addr == 0xFFFFFFFF) { + if (addr == 0xFFFFFFFF || ((addr & LINKLOCAL_ADDR) == + LINKLOCAL_ADDR)) { addr = 0; } else { g_free(dhcp_client->last_address); -- cgit v1.2.3