int __connman_ipconfig_address_remove(struct connman_ipconfig *ipconfig)
{
+ int err;
+
DBG("");
if (ipconfig == NULL)
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;