diff options
author | Saurav Babu <saurav.babu@samsung.com> | 2016-02-03 19:41:09 +0530 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2016-02-12 11:20:39 +0200 |
commit | 74ca47dbe96b489afa49192b3d5e244ab0e72f83 (patch) | |
tree | b9ad585ca3f5f372317acc135724b2fd51d24542 | |
parent | 60b148269a5c972408a8948a6593315e313e114c (diff) | |
download | connman-74ca47dbe96b489afa49192b3d5e244ab0e72f83.tar.gz |
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.
-rw-r--r-- | gdhcp/client.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gdhcp/client.c b/gdhcp/client.c index 3bf8cb2b..9012b382 100644 --- a/gdhcp/client.c +++ b/gdhcp/client.c @@ -2832,7 +2832,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 if (dhcp_client->last_address != last_address) { g_free(dhcp_client->last_address); |