diff options
author | leena.gunda@wipro.com <leena.gunda@wipro.com> | 2010-10-06 19:01:12 +0530 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2010-10-07 20:41:56 +0200 |
commit | e25a8f5e79b81f5c5b12f74d1b8b197d2a13b2ac (patch) | |
tree | c3a8d61cc505d5242c7688384880cb328b3a883c /src | |
parent | 1fdc889f14ad169adce8cdfd624a56c260ac7053 (diff) | |
download | connman-e25a8f5e79b81f5c5b12f74d1b8b197d2a13b2ac.tar.gz connman-e25a8f5e79b81f5c5b12f74d1b8b197d2a13b2ac.tar.bz2 connman-e25a8f5e79b81f5c5b12f74d1b8b197d2a13b2ac.zip |
Display IPv4/IPv6 gateway in PropertyChanged signal
ConnMan should emit the IP PropertyChanged signal when the IP is set but
also when a route for the device is set.
Fixes BMC#7895
Diffstat (limited to 'src')
-rw-r--r-- | src/ipconfig.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/ipconfig.c b/src/ipconfig.c index 0a7eb8bc..2b60e2df 100644 --- a/src/ipconfig.c +++ b/src/ipconfig.c @@ -707,6 +707,7 @@ void __connman_ipconfig_newroute(int index, int family, unsigned char scope, if (scope == 0 && g_strcmp0(dst, "0.0.0.0") == 0) { GSList *list; + GList *config_list; if (family == AF_INET6) { g_free(ipdevice->ipv6_gateway); @@ -728,6 +729,20 @@ void __connman_ipconfig_newroute(int index, int family, unsigned char scope, g_free(ipaddress->gateway); ipaddress->gateway = g_strdup(gateway); } + + for (config_list = g_list_first(ipconfig_list); config_list; + config_list = g_list_next(config_list)) { + struct connman_ipconfig *ipconfig = config_list->data; + + if (index != ipconfig->index) + continue; + + if (ipconfig->ops == NULL) + continue; + + if (ipconfig->ops->ip_bound) + ipconfig->ops->ip_bound(ipconfig); + } } connman_info("%s {add} route %s gw %s scope %u <%s>", @@ -748,6 +763,7 @@ void __connman_ipconfig_delroute(int index, int family, unsigned char scope, if (scope == 0 && g_strcmp0(dst, "0.0.0.0") == 0) { GSList *list; + GList *config_list; if (family == AF_INET6) { g_free(ipdevice->ipv6_gateway); @@ -769,6 +785,20 @@ void __connman_ipconfig_delroute(int index, int family, unsigned char scope, g_free(ipaddress->gateway); ipaddress->gateway = NULL; } + + for (config_list = g_list_first(ipconfig_list); config_list; + config_list = g_list_next(config_list)) { + struct connman_ipconfig *ipconfig = config_list->data; + + if (index != ipconfig->index) + continue; + + if (ipconfig->ops == NULL) + continue; + + if (ipconfig->ops->ip_release) + ipconfig->ops->ip_release(ipconfig); + } } connman_info("%s {del} route %s gw %s scope %u <%s>", |