+ __connman_service_indicate_default(data->service);
+}
+
+static void unset_default_gateway(struct gateway_data *data,
+ enum connman_ipconfig_type type)
+{
+ int index;
+ int do_ipv4 = FALSE, do_ipv6 = FALSE;
+
+ if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
+ do_ipv4 = TRUE;
+ else if (type == CONNMAN_IPCONFIG_TYPE_IPV6)
+ do_ipv6 = TRUE;
+ else
+ do_ipv4 = do_ipv6 = TRUE;
+
+ DBG("type %d gateway ipv4 %p ipv6 %p", type, data->ipv4_gateway,
+ data->ipv6_gateway);
+
+ if (do_ipv4 == TRUE && data->ipv4_gateway != NULL &&
+ data->ipv4_gateway->vpn == TRUE) {
+ connman_inet_del_host_route(data->index,
+ data->ipv4_gateway->vpn_ip);
+ connman_inet_clear_gateway_address(data->index,
+ data->ipv4_gateway->vpn_ip);
+ data->ipv4_gateway->active = FALSE;
+
+ DBG("unset %p index %d vpn %s index %d phy %s",
+ data, data->index, data->ipv4_gateway->vpn_ip,
+ data->ipv4_gateway->vpn_phy_index,
+ data->ipv4_gateway->vpn_phy_ip);
+
+ return;
+ }
+
+ if (do_ipv6 == TRUE && data->ipv6_gateway != NULL &&
+ data->ipv6_gateway->vpn == TRUE) {
+ connman_inet_del_ipv6_host_route(data->index,
+ data->ipv6_gateway->vpn_ip);
+ connman_inet_clear_ipv6_gateway_address(data->index,
+ data->ipv6_gateway->vpn_ip);
+ data->ipv6_gateway->active = FALSE;
+
+ DBG("unset %p index %d vpn %s index %d phy %s",
+ data, data->index, data->ipv6_gateway->vpn_ip,
+ data->ipv6_gateway->vpn_phy_index,
+ data->ipv6_gateway->vpn_phy_ip);
+
+ return;
+ }
+
+ index = __connman_service_get_index(data->service);
+
+ if (do_ipv4 == TRUE && data->ipv4_gateway != NULL &&
+ g_strcmp0(data->ipv4_gateway->gateway,
+ "0.0.0.0") == 0) {
+ connman_inet_clear_gateway_interface(index);
+ return;
+ }
+
+ if (do_ipv6 == TRUE && data->ipv6_gateway != NULL &&
+ g_strcmp0(data->ipv6_gateway->gateway,
+ "::") == 0) {
+ connman_inet_clear_ipv6_gateway_interface(index);
+ return;
+ }
+
+ if (do_ipv6 == TRUE && data->ipv6_gateway != NULL)
+ connman_inet_clear_ipv6_gateway_address(index,
+ data->ipv6_gateway->gateway);
+
+ if (do_ipv4 == TRUE && data->ipv4_gateway != NULL)
+ connman_inet_clear_gateway_address(index,
+ data->ipv4_gateway->gateway);