if (ipdevice == NULL)
return;
- if (scope == 0 && g_strcmp0(dst, "0.0.0.0") == 0) {
+ if (scope == 0 && (g_strcmp0(dst, "0.0.0.0") == 0 ||
+ g_strcmp0(dst, "::") == 0)) {
GSList *list;
GList *config_list;
ipdevice->config_ipv6->system->gateway =
g_strdup(gateway);
}
- } else {
+ } else if (family == AF_INET) {
g_free(ipdevice->ipv4_gateway);
ipdevice->ipv4_gateway = g_strdup(gateway);
ipdevice->config_ipv4->system->gateway =
g_strdup(gateway);
}
- }
+ } else
+ return;
for (list = ipdevice->address_list; list; list = list->next) {
struct connman_ipaddress *ipaddress = list->data;
if (ipdevice == NULL)
return;
- if (scope == 0 && g_strcmp0(dst, "0.0.0.0") == 0) {
+ if (scope == 0 && (g_strcmp0(dst, "0.0.0.0") == 0 ||
+ g_strcmp0(dst, "::") == 0)) {
GSList *list;
GList *config_list;
g_free(ipdevice->config_ipv6->system->gateway);
ipdevice->config_ipv6->system->gateway = NULL;
}
- } else {
+ } else if (family == AF_INET) {
g_free(ipdevice->ipv4_gateway);
ipdevice->ipv4_gateway = NULL;
g_free(ipdevice->config_ipv4->system->gateway);
ipdevice->config_ipv4->system->gateway = NULL;
}
- }
+ } else
+ return;
for (list = ipdevice->address_list; list; list = list->next) {
struct connman_ipaddress *ipaddress = list->data;