diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2012-11-01 14:16:24 +0200 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-11-02 10:42:24 +0200 |
commit | 746026f897643111b4ca26bcad132de4e27d30fc (patch) | |
tree | d320ff3a58842d2f02a3d987d22b9f54dcbe738c /src/dhcp.c | |
parent | 3a8c097be7d5ddcc654b9a6c42facb7010292d05 (diff) | |
download | connman-746026f897643111b4ca26bcad132de4e27d30fc.tar.gz connman-746026f897643111b4ca26bcad132de4e27d30fc.tar.bz2 connman-746026f897643111b4ca26bcad132de4e27d30fc.zip |
dhcp: Clear ipaddresses from ipconfig before starting DHCP
This is needed if manually configured addresses were used and later
DHCP was taken into use. If the manually configured IP information
(address, netmask and gateway) and the information given by DHCP is the
same, DHCP will not set the IP address to the interface.
Diffstat (limited to 'src/dhcp.c')
-rw-r--r-- | src/dhcp.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -449,6 +449,12 @@ static int dhcp_request(struct connman_dhcp *dhcp) service = connman_service_lookup_from_network(dhcp->network); ipconfig = __connman_service_get_ip4config(service); + /* + * Clear the addresses at startup so that lease callback will + * take the lease and set ip address properly. + */ + __connman_ipconfig_clear_address(ipconfig); + return g_dhcp_client_start(dhcp_client, __connman_ipconfig_get_dhcp_address(ipconfig)); } |