diff options
-rwxr-xr-x | src/connection.c | 17 | ||||
-rwxr-xr-x | src/connman.h | 3 | ||||
-rwxr-xr-x | src/ipconfig.c | 24 |
3 files changed, 44 insertions, 0 deletions
diff --git a/src/connection.c b/src/connection.c index 6036db31..c18701a7 100755 --- a/src/connection.c +++ b/src/connection.c @@ -1114,6 +1114,23 @@ bool __connman_connection_update_gateway(void) return updated; } +#if defined TIZEN_EXT +void __connman_connection_update_default_gateway(void) +{ + struct gateway_data *default_gateway; + + default_gateway = find_default_gateway(); + DBG("default %p", default_gateway); + + if (!default_gateway) + return; + + if (default_gateway->ipv4_gateway) + set_default_gateway(default_gateway, + CONNMAN_IPCONFIG_TYPE_IPV4); +} +#endif + int __connman_connection_get_vpn_index(int phy_index) { GHashTableIter iter; diff --git a/src/connman.h b/src/connman.h index e92f2b1a..e63eb9d5 100755 --- a/src/connman.h +++ b/src/connman.h @@ -541,6 +541,9 @@ void __connman_connection_gateway_remove(struct connman_service *service, int __connman_connection_get_vpn_index(int phy_index); bool __connman_connection_update_gateway(void); +#if defined TIZEN_EXT +void __connman_connection_update_default_gateway(void); +#endif typedef void (*__connman_ntp_cb_t) (bool success, void *user_data); int __connman_ntp_start(char *server, __connman_ntp_cb_t callback, diff --git a/src/ipconfig.c b/src/ipconfig.c index 8c21db5d..ec4c396f 100755 --- a/src/ipconfig.c +++ b/src/ipconfig.c @@ -785,6 +785,30 @@ int __connman_ipconfig_newaddr(int index, int family, const char *label, ipconfig->ops->ip_bound(ipconfig, ifname); } +#if defined TIZEN_EXT + const char *local; + struct connman_service *service; + struct connman_ipconfig *local_ipconfig; + + service = connman_service_get_default(); + if (!service) + goto out; + + local_ipconfig = __connman_service_get_ip4config(service); + if (!local_ipconfig) + goto out; + + local = __connman_ipconfig_get_local(local_ipconfig); + if (!local) + goto out; + + DBG("local %s", local); + + if (g_strcmp0(local, address) != 0) + goto out; + + __connman_connection_update_default_gateway(); +#endif out: g_free(ifname); return 0; |