summaryrefslogtreecommitdiff
path: root/src/ipconfig.c
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2011-03-22 21:41:23 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2011-03-22 21:41:23 +0100
commitbab0bb3cb11b7ce145621f162de89cd34d3f5502 (patch)
tree0c04f99c6dc0a3fd7f3db0ac12ce13ab068cf614 /src/ipconfig.c
parent37fb27c85e07cf06a451b674682a36a0207a6875 (diff)
downloadconnman-bab0bb3cb11b7ce145621f162de89cd34d3f5502.tar.gz
connman-bab0bb3cb11b7ce145621f162de89cd34d3f5502.tar.bz2
connman-bab0bb3cb11b7ce145621f162de89cd34d3f5502.zip
ipconfig: Clear ipconfig address when removing it
Diffstat (limited to 'src/ipconfig.c')
-rw-r--r--src/ipconfig.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/ipconfig.c b/src/ipconfig.c
index 9f0d5d9f..0599a73c 100644
--- a/src/ipconfig.c
+++ b/src/ipconfig.c
@@ -1365,6 +1365,8 @@ int __connman_ipconfig_address_add(struct connman_ipconfig *ipconfig)
int __connman_ipconfig_address_remove(struct connman_ipconfig *ipconfig)
{
+ int err;
+
DBG("");
if (ipconfig == NULL)
@@ -1381,13 +1383,19 @@ int __connman_ipconfig_address_remove(struct connman_ipconfig *ipconfig)
case CONNMAN_IPCONFIG_METHOD_DHCP:
case CONNMAN_IPCONFIG_METHOD_MANUAL:
if (ipconfig->type == CONNMAN_IPCONFIG_TYPE_IPV4)
- return connman_inet_clear_address(ipconfig->index,
+ err = connman_inet_clear_address(ipconfig->index,
ipconfig->address);
else if (ipconfig->type == CONNMAN_IPCONFIG_TYPE_IPV6)
- return connman_inet_clear_ipv6_address(
+ err = connman_inet_clear_ipv6_address(
ipconfig->index,
ipconfig->address->local,
ipconfig->address->prefixlen);
+ else
+ err = -EINVAL;
+
+ connman_ipaddress_clear(ipconfig->address);
+
+ return err;
}
return 0;