X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fconnection.c;h=64d48b7d51901cd58a9968743e98db13a6e4ea8a;hb=30602f521a85820a9f6b7ac04876400e00c68b15;hp=6b005e7f53452a943d7705105e8e6cffd1699279;hpb=9362752a471a5c892d679548fbf2828d5fc5684b;p=platform%2Fupstream%2Fconnman.git diff --git a/src/connection.c b/src/connection.c old mode 100644 new mode 100755 index 6b005e7..64d48b7 --- a/src/connection.c +++ b/src/connection.c @@ -657,8 +657,15 @@ static void connection_newgateway(int index, const char *gateway) } if (!found) { +#if defined TIZEN_EXT + if (data->ipv4_gateway != NULL){ + set_default_gateway(data, CONNMAN_IPCONFIG_TYPE_IPV4); + connman_check_proxy_setup_and_wispr_start(data->service); + } +#else if (data->ipv4_gateway) set_default_gateway(data, CONNMAN_IPCONFIG_TYPE_IPV4); +#endif if (data->ipv6_gateway) set_default_gateway(data, CONNMAN_IPCONFIG_TYPE_IPV6); @@ -786,6 +793,32 @@ static void add_host_route(int family, int index, const char *gateway, } } +#if defined TIZEN_EXT +static bool __connman_service_is_not_cellular_internet_profile( + struct connman_service *cellular) +{ + char *suffix; + const char *path; + const char internet_suffix[] = "_1"; + const char prepaid_internet_suffix[] = "_3"; + + if (connman_service_get_type(cellular) != CONNMAN_SERVICE_TYPE_CELLULAR) + return FALSE; + + path = __connman_service_get_path(cellular); + + suffix = strrchr(path, '_'); + + if (g_strcmp0(suffix, internet_suffix) != 0 && + g_strcmp0(suffix, prepaid_internet_suffix) != 0) { + DBG("not internet service profile: %s", path); + return TRUE; + } + + return FALSE; +} +#endif + int __connman_connection_gateway_add(struct connman_service *service, const char *gateway, enum connman_ipconfig_type type, @@ -812,6 +845,28 @@ int __connman_connection_gateway_add(struct connman_service *service, if (!gateway && type == CONNMAN_IPCONFIG_TYPE_IPV6) gateway = "::"; +#if defined TIZEN_EXT + if (__connman_service_is_not_cellular_internet_profile(service) == TRUE) { + /* not internet service should not be default gateway */ + + DBG("no internet service %p index %d gateway %s vpn ip %s type %d", + service, index, gateway, peer, type); + + if (type == CONNMAN_IPCONFIG_TYPE_IPV4) { + add_host_route(AF_INET, index, gateway, service_type); + __connman_service_nameserver_add_routes(service, gateway); + type4 = CONNMAN_IPCONFIG_TYPE_IPV4; + } + + if (type == CONNMAN_IPCONFIG_TYPE_IPV6) { + add_host_route(AF_INET6, index, gateway, service_type); + __connman_service_nameserver_add_routes(service, gateway); + type6 = CONNMAN_IPCONFIG_TYPE_IPV6; + } + + goto done; + } +#endif DBG("service %p index %d gateway %s vpn ip %s type %d", service, index, gateway, peer, type); @@ -856,6 +911,12 @@ int __connman_connection_gateway_add(struct connman_service *service, } if (!active_gateway) { +#if defined TIZEN_EXT + if(new_gateway->ipv4_gateway) + DBG("ConnMan, Set default gateway[%s], active[%d]", + new_gateway->ipv4_gateway->gateway, + new_gateway->ipv4_gateway->active); +#endif set_default_gateway(new_gateway, type); goto done; } @@ -971,6 +1032,9 @@ bool __connman_connection_update_gateway(void) bool updated = false; GHashTableIter iter; gpointer value, key; +#if defined TIZEN_EXT + static struct gateway_data *old_default = NULL; +#endif if (!gateway_hash) return updated; @@ -1008,6 +1072,12 @@ bool __connman_connection_update_gateway(void) } } +#if defined TIZEN_EXT + if (updated == false && old_default != default_gateway) { + updated = true; + old_default = default_gateway; + } +#endif if (updated && default_gateway) { if (default_gateway->ipv4_gateway) set_default_gateway(default_gateway,