summaryrefslogtreecommitdiff
path: root/gdhcp
diff options
context:
space:
mode:
authorSaurav Babu <saurav.babu@samsung.com>2016-03-01 17:10:31 +0530
committerSaurav Babu <saurav.babu@samsung.com>2016-03-01 17:10:31 +0530
commitea435fc085c16ebd3d40521d362ad0ccddfbad48 (patch)
treef3e3b8b8bf5c9bf80116a7029198ef63f5c69633 /gdhcp
parent6a2a42602335d539ad18f2070534f8d8a1eedef7 (diff)
downloadconnman-ea435fc085c16ebd3d40521d362ad0ccddfbad48.tar.gz
connman-ea435fc085c16ebd3d40521d362ad0ccddfbad48.tar.bz2
connman-ea435fc085c16ebd3d40521d362ad0ccddfbad48.zip
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 <saurav.babu@samsung.com>
Diffstat (limited to 'gdhcp')
-rwxr-xr-xgdhcp/client.c3
1 files changed, 2 insertions, 1 deletions
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);