diff options
author | Jukka Rissanen <jukka.rissanen@nokia.com> | 2011-02-18 15:48:56 +0200 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-03-02 17:16:45 +0100 |
commit | bbbb938cb28a11fa6b794c476bd13a486668e33b (patch) | |
tree | dec82375dd757113fb4519181c6c9cd64ae1094e /src/ipconfig.c | |
parent | 8046b3071ea592f23e7d66834fab2cd592207bfb (diff) | |
download | connman-bbbb938cb28a11fa6b794c476bd13a486668e33b.tar.gz connman-bbbb938cb28a11fa6b794c476bd13a486668e33b.tar.bz2 connman-bbbb938cb28a11fa6b794c476bd13a486668e33b.zip |
ipconfig: Catch IPv6 default route creation and deletion.
Diffstat (limited to 'src/ipconfig.c')
-rw-r--r-- | src/ipconfig.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/ipconfig.c b/src/ipconfig.c index 7eea909f..9f0d5d9f 100644 --- a/src/ipconfig.c +++ b/src/ipconfig.c @@ -802,7 +802,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; @@ -816,7 +817,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); @@ -826,7 +827,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; @@ -866,7 +868,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; @@ -879,7 +882,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; @@ -888,7 +891,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; |