--- src/ipconfig.c | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/ipconfig.c b/src/ipconfig.c index 62d3766..59dd987 100644 --- a/src/ipconfig.c +++ b/src/ipconfig.c @@ -720,7 +720,8 @@ void __connman_ipconfig_newroute(int index, int family, unsigned char scope, 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; @@ -734,7 +735,7 @@ void __connman_ipconfig_newroute(int index, int family, unsigned char scope, 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); @@ -744,7 +745,8 @@ void __connman_ipconfig_newroute(int index, int family, unsigned char scope, 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; @@ -784,7 +786,8 @@ void __connman_ipconfig_delroute(int index, int family, unsigned char scope, 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; @@ -797,7 +800,7 @@ void __connman_ipconfig_delroute(int index, int family, unsigned char scope, 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; @@ -806,7 +809,8 @@ void __connman_ipconfig_delroute(int index, int family, unsigned char scope, 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; -- 1.7.0.4 _______________________________________________ connman mailing list connman@connman.net http://lists.connman.net/listinfo/connman