From 0c0f02420dd27ed12a7f5d28ac6e6990e51ce884 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Wed, 3 Nov 2010 10:31:17 +0100 Subject: [PATCH] connection: Prefer IPv4 peer over the regular address If the peer IPv4 address is set, this will be the gateway address. --- src/connection.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/connection.c b/src/connection.c index 0e7a790..bac700f 100644 --- a/src/connection.c +++ b/src/connection.c @@ -288,7 +288,13 @@ static int connection_probe(struct connman_element *element) CONNMAN_PROPERTY_ID_IPV6_GATEWAY, &ipv6_gateway); connman_element_get_value(element, - CONNMAN_PROPERTY_ID_IPV4_ADDRESS, &vpn_ip); + CONNMAN_PROPERTY_ID_IPV4_PEER, &vpn_ip); + + if (vpn_ip == NULL) + connman_element_get_value(element, + CONNMAN_PROPERTY_ID_IPV4_ADDRESS, &vpn_ip); + + DBG("vpn_ip %s", vpn_ip); connman_element_get_value(element, CONNMAN_PROPERTY_ID_DOMAINNAME, &domainname); -- 2.7.4