diff options
author | Yu A Wang <yu.a.wang@intel.com> | 2011-08-12 02:42:16 -0400 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-08-16 20:32:14 +0200 |
commit | a84e87b617f0c1bfd08d3f9830dd29eb2c49a26e (patch) | |
tree | 93f7bcb71bac1214acc67401b080a7b6d232244a /src/connection.c | |
parent | 7de48d7f6641d440f631d1b6d4c79ae480874f99 (diff) | |
download | connman-a84e87b617f0c1bfd08d3f9830dd29eb2c49a26e.tar.gz connman-a84e87b617f0c1bfd08d3f9830dd29eb2c49a26e.tar.bz2 connman-a84e87b617f0c1bfd08d3f9830dd29eb2c49a26e.zip |
connection: Set proper gateway for ppp links
The default gateway for ppp connection should be 0.0.0.0 for ipv4
and :: for ipv6. This issue fixed before but removed by the commit
84a739d0082b89efa8cfbf376abe17937e4bc843
Diffstat (limited to 'src/connection.c')
-rw-r--r-- | src/connection.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/connection.c b/src/connection.c index 4f3b3f89..bd0a21ed 100644 --- a/src/connection.c +++ b/src/connection.c @@ -453,6 +453,17 @@ int __connman_connection_gateway_add(struct connman_service *service, DBG("service %p index %d gateway %s vpn ip %s type %d", service, index, gateway, peer, type); + /* + * If gateway is NULL, it's a point to point link and the default + * gateway for ipv4 is 0.0.0.0 and for ipv6 is ::, meaning the + * interface + */ + if (gateway == NULL && type == CONNMAN_IPCONFIG_TYPE_IPV4) + gateway = "0.0.0.0"; + + if (gateway == NULL && type == CONNMAN_IPCONFIG_TYPE_IPV6) + gateway = "::"; + active_gateway = find_active_gateway(); new_gateway = add_gateway(service, index, gateway, type); if (new_gateway == NULL) |