Send connman mailing list submissions to
        [email protected]

To subscribe or unsubscribe via email, send a message with subject or
body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."

Today's Topics:

   1. Connman 1.37 no ntp without DNS server ([email protected])
   2. [PATCH 0/6] Support SplitRouting variable on vpnd
      (Jussi Laakkonen)
   3. [PATCH 1/6] service: Expose set_split_routing() for internal use
      (Jussi Laakkonen)
   4. [PATCH 2/6] provider: Expose split routing variable in VPN properties
      (Jussi Laakkonen)
   5. [PATCH 3/6] vpn: Add SplitRouting to supported D-Bus variables
      (Jussi Laakkonen)


----------------------------------------------------------------------

Date: Thu, 17 Sep 2020 08:48:40 -0000
From: [email protected]
Subject: Connman 1.37 no ntp without DNS server
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

Hi,

I discovered that connman 1.37 does not use a NTP server if there is no DNS 
server specified, even if the NTP server is specified as IPv4 address. With DNS 
server entry NTP works fine.

How I tested this:
connmanctl> config ethernet_00602f94b8cd_cable --ipv4 manual 192.168.50.22 
255.255.255.0 192.168.50.248 --timeservers 138.201.16.225

connmanctl> services ethernet_00602f94b8cd_cable
/net/connman/service/ethernet_00602f94b8cd_cable
  Type = ethernet
  Security = [  ]
  State = ready
  Favorite = True
  Immutable = False
  AutoConnect = True
  Name = Wired
  Ethernet = [ Method=auto, Interface=eth0, Address=00:60:2F:94:B8:CD, MTU=1500 
]
  IPv4 = [ Method=manual, Address=192.168.50.22, Netmask=255.255.255.0, 
Gateway=192.168.50.248 ]
  IPv4.Configuration = [ Method=manual, Address=192.168.50.22, 
Netmask=255.255.255.0, Gateway=192.168.50.248 ]
  IPv6 = [  ]
  IPv6.Configuration = [ Method=auto, Privacy=disabled ]
  Nameservers = [  ]
  Nameservers.Configuration = [  ]
  Timeservers = [ 138.201.16.225 ]
  Timeservers.Configuration = [ 138.201.16.225 ]
  Domains = [  ]
  Domains.Configuration = [  ]
  Proxy = [ Method=direct ]
  Proxy.Configuration = [  ]
  mDNS = False
  mDNS.Configuration = False
  Provider = [  ]

I can ping the timeserver after the connection is established, but the time is 
not set on the system:
# ping 138.201.16.225
PING 138.201.16.225 (138.201.16.225): 56 data bytes
64 bytes from 138.201.16.225: seq=0 ttl=56 time=28.087 ms
64 bytes from 138.201.16.225: seq=1 ttl=56 time=26.476 ms
^C
--- 138.201.16.225 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 26.476/27.281/28.087 ms

Connmand shows me the following log:

1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/service.c:__connman_service_ipconfig_indicate_state()
 service 0xebaf80 (ethernet_00602f94b8cd_cable) old state 3 (configuration) new 
state 4 (ready) type 1 ()
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/wpad.c:__connman_wpad_start()
 service 0xebaf80
1970-01-01T00:02:27+00:00|(none)||connmand|debug|plugins/pacrunner.c:proxy_changed()
 service 0xebaf80
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/service.c:__connman_service_wispr_start()
 service 0xebaf80 type IPv4
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/wispr.c:__connman_wispr_start()
 service 0xebaf80
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/wispr.c:wispr_portal_detect()
 wispr/portal context 0xeba078 service 0xebaf80
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/wispr.c:wispr_portal_detect()
 interface eth0
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/wispr.c:wispr_portal_detect()
 Could not get nameservers
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/service.c:service_rp_filter()
 connected ethernet_00602f94b8cd_cable ipconfig 0xeb6be8 method 3 count 1 
filter 0
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/service.c:service_indicate_state()
 service 0xebaf80 old configuration - new ready/idle => ready
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/session.c:service_state_changed()
 service 0xebaf80 state 4
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/service.c:default_changed()
 current default (nil) 
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/service.c:default_changed()
 new default 0xebaf80 ethernet_00602f94b8cd_cable
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/dnsproxy.c:dnsproxy_default_changed()
 service 0xebaf80
1970-01-01T00:02:27+00:00|(none)||connmand|debug|plugins/pacrunner.c:default_service_changed()
 service 0xebaf80
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/timeserver.c:timeserver_start()
 service 0xebaf80
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/nat.c:update_default_interface()
 interface eth0
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/service.c:service_save() 
service 0xebaf80 new 0
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/ipconfig.c:__connman_ipconfig_save()
 ipconfig 0xeb6be8 identifier ethernet_00602f94b8cd_cable method manual
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/ipconfig.c:__connman_ipconfig_save()
 ipconfig 0xeb9178 identifier ethernet_00602f94b8cd_cable method auto
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/notifier.c:__connman_notifier_connect()
 type 2
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/technology.c:technology_find()
 type 2
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/technology.c:__connman_technology_set_connected()
 technology 0xebb840 connected 1
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/connection.c:__connman_connection_update_gateway()
 default 0xeb9a60
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/connection.c:set_default_gateway()
 type 1 gateway ipv4 0xeba548 ipv6 (nil)
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/inet.c:iproute_default_modify()
 gateway 192.168.50.248/0 table 254
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/inet.c:__connman_inet_rtnl_open()
 fd 17
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/inet.c:__connman_inet_rtnl_talk()
 handle 0x7e476298 len 44
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/inet.c:__connman_inet_rtnl_close()
 handle 0x7e476298
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/service.c:__connman_service_indicate_default()
 service 0xebaf80 state ready
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/network.c:set_configuration()
 network 0xeb9328
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/service.c:__connman_service_ipconfig_indicate_state()
 service 0xebaf80 (ethernet_00602f94b8cd_cable) old state 1 (idle) new state 3 
(configuration) type 2 (I)
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/service.c:service_indicate_state()
 service 0xebaf80 old ready - new ready/configuration => ready
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/network.c:__connman_network_enable_ipconfig()
 ipv6 ipconfig method 5
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/network.c:autoconf_ipv6_set()
 network 0xeb9328
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/ipconfig.c:__connman_ipconfig_enable()
 ipconfig 0xeb9178
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/ipconfig.c:__connman_ipconfig_ref_debug()
 0xeb9178 ref 2 by src/ipconfig.c:1579:__connman_ipconfig_enable()
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/ipconfig.c:enable_ipv6() 
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/service.c:service_up() 
eth0 up
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/service.c:service_lower_up()
 eth0 lower up
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/service.c:stats_start() 
service 0xebaf80
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/ipconfig.c:enable_ipv6() 
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/inet.c:connman_inet_clear_ipv6_address()
 index 2 address (null) prefix_len 0
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/network.c:connman_network_ref_debug()
 0xeb9328 name Wired ref 4 by src/network.c:907:autoconf_ipv6_set()
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/inet.c:__connman_inet_ipv6_send_rs()
 sock 17
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/inet.c:ndisc_send_unspec() 
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/service.c:__connman_service_connect()
 service 0xebaf80 err 0
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/rtnl.c:rtnl_message() 
NEWADDR len 88 type 20 flags 0x0000 seq 1 pid 3678356348
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/ipconfig.c:__connman_ipconfig_newaddr()
 index 2
1970-01-01T00:02:27+00:00|(none)||connmand|info|eth0 {add} address 
192.168.50.22/24 label eth0 family 2
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/service.c:service_ip_bound()
 eth0 ip bound
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/service.c:service_ip_bound()
 service 0xebaf80 ipconfig 0xeb6be8 type 1 method 3
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/session.c:ipconfig_changed()
 service 0xebaf80 ipconfig 0xeb6be8
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/rtnl.c:rtnl_message() 
NEWROUTE len 60 type 24 flags 0x0000 seq 0 pid 0
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/rtnl.c:rtnl_message() 
NEWROUTE len 60 type 24 flags 0x0000 seq 0 pid 0
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/rtnl.c:rtnl_message() 
NEWROUTE len 60 type 24 flags 0x0000 seq 0 pid 0
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/ipconfig.c:__connman_ipconfig_newroute()
 index 2
1970-01-01T00:02:27+00:00|(none)||connmand|info|eth0 {add} route 192.168.50.0 
gw 0.0.0.0 scope 253 <LINK>
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/rtnl.c:rtnl_message() 
NEWROUTE len 60 type 24 flags 0x0000 seq 0 pid 0
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/rtnl.c:rtnl_message() 
NEWROUTE len 52 type 24 flags 0x0000 seq 0 pid 0
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/ipconfig.c:__connman_ipconfig_newroute()
 index 2
1970-01-01T00:02:27+00:00|(none)||connmand|info|eth0 {add} route 192.168.50.248 
gw 0.0.0.0 scope 253 <LINK>
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/rtnl.c:rtnl_message() 
NEWROUTE len 52 type 24 flags 0x0000 seq 148 pid 3257535480
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/ipconfig.c:__connman_ipconfig_newroute()
 index 2
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/service.c:service_route_changed()
 eth0 route changed
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/session.c:ipconfig_changed()
 service 0xebaf80 ipconfig 0xeb6be8
1970-01-01T00:02:27+00:00|(none)||connmand|info|eth0 {add} route 0.0.0.0 gw 
192.168.50.248 scope 0 <UNIVERSE>
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/connection.c:connection_newgateway()
 index 2 gateway 192.168.50.248
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/connection.c:set_default_gateway()
 type 1 gateway ipv4 0xeba548 ipv6 (nil)
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/inet.c:iproute_default_modify()
 gateway 192.168.50.248/0 table 254
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/inet.c:__connman_inet_rtnl_open()
 fd 18
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/inet.c:__connman_inet_rtnl_talk()
 handle 0x7e476590 len 44
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/inet.c:__connman_inet_rtnl_close()
 handle 0x7e476590
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/service.c:__connman_service_indicate_default()
 service 0xebaf80 state ready
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/service.c:service_send_changed()
 
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/service.c:service_append_added_foreach()
 new /net/connman/service/ethernet_00602f94b8cd_cable
1970-01-01T00:02:27+00:00|(none)||connmand|debug|src/service.c:append_dns() 
append fallback nameservers
1970-01-01T00:02:29+00:00|(none)||connmand|debug|src/rtnl.c:rtnl_message() 
NEWADDR len 72 type 20 flags 0x0000 seq 0 pid 0
1970-01-01T00:02:29+00:00|(none)||connmand|debug|src/rtnl.c:rtnl_message() 
NEWROUTE len 116 type 24 flags 0x0000 seq 0 pid 0
1970-01-01T00:02:32+00:00|(none)||connmand|debug|src/inet.c:rs_timeout_cb() 
user data 0xebc150
1970-01-01T00:02:32+00:00|(none)||connmand|debug|src/network.c:check_dhcpv6() 
reply (nil)
1970-01-01T00:02:32+00:00|(none)||connmand|debug|src/network.c:check_dhcpv6() 
re-send router solicitation 3
1970-01-01T00:02:32+00:00|(none)||connmand|debug|src/inet.c:__connman_inet_ipv6_send_rs()
 sock 18
1970-01-01T00:02:32+00:00|(none)||connmand|debug|src/inet.c:ndisc_send_unspec() 
1970-01-01T00:02:36+00:00|(none)||connmand|debug|src/inet.c:rs_timeout_cb() 
user data 0xebc230
1970-01-01T00:02:36+00:00|(none)||connmand|debug|src/network.c:check_dhcpv6() 
reply (nil)
1970-01-01T00:02:36+00:00|(none)||connmand|debug|src/network.c:check_dhcpv6() 
re-send router solicitation 2
1970-01-01T00:02:36+00:00|(none)||connmand|debug|src/inet.c:__connman_inet_ipv6_send_rs()
 sock 17
1970-01-01T00:02:36+00:00|(none)||connmand|debug|src/inet.c:ndisc_send_unspec() 
1970-01-01T00:02:40+00:00|(none)||connmand|debug|src/inet.c:rs_timeout_cb() 
user data 0xeaeb98
1970-01-01T00:02:40+00:00|(none)||connmand|debug|src/network.c:check_dhcpv6() 
reply (nil)
1970-01-01T00:02:40+00:00|(none)||connmand|debug|src/network.c:check_dhcpv6() 
re-send router solicitation 1
1970-01-01T00:02:40+00:00|(none)||connmand|debug|src/inet.c:__connman_inet_ipv6_send_rs()
 sock 18
1970-01-01T00:02:40+00:00|(none)||connmand|debug|src/inet.c:ndisc_send_unspec() 
1970-01-01T00:02:44+00:00|(none)||connmand|debug|src/inet.c:rs_timeout_cb() 
user data 0xeb9210
1970-01-01T00:02:44+00:00|(none)||connmand|debug|src/network.c:check_dhcpv6() 
reply (nil)
1970-01-01T00:02:44+00:00|(none)||connmand|debug|src/network.c:connman_network_unref_debug()
 0xeb9328 name Wired ref 3 by src/network.c:766:check_dhcpv6()

------------------------------

Date: Thu, 17 Sep 2020 18:37:10 +0300
From: Jussi Laakkonen <[email protected]>
Subject: [PATCH 0/6] Support SplitRouting variable on vpnd
To: [email protected]
Message-ID: <[email protected]>

Add support for SplitRouting variable on vpnd. This is amended to VPN
connection API as boolean parameter and allows to use the API for defining
whether to use the VPN as default route (SplitRouting=false) or not. The value
defaults to false.

On connmand side SplitRouting is exposed for VPN plugin via provider.
SplitRouting is also added to supported D-Bus variables in VPN plugin.

On vpnd side vpn-config.c is amended with support to retrieve boolean from
keyfile and used in vpn-provider.c. Warning is printed if SplitRouting is
attempted to be added as string and thus, vpn_provider_set_boolean() is added.

Additionally checks for whether the default route has been added for a VPN is
implemented. Adding a default route is being prevented for split routed VPNs
and enforced on non-split routed VPNs, when the default route should be set.

Jussi Laakkonen (6):
  service: Expose set_split_routing() for internal use
  provider: Expose split routing variable in VPN properties
  vpn: Add SplitRouting to supported D-Bus variables
  vpn-config: Implement function to get boolean from keyfile
  vpn-provider: Support split routing option for VPN providers
  doc: Document VPN connection SplitRouting boolean

 doc/vpn-connection-api.txt |   9 +-
 include/provider.h         |   2 +
 plugins/vpn.c              |  16 +++-
 src/connman.h              |   2 +
 src/provider.c             |  18 ++++
 src/service.c              |  23 +++--
 vpn/vpn-config.c           |  15 +++
 vpn/vpn-provider.c         | 182 ++++++++++++++++++++++++++++++++-----
 vpn/vpn-provider.h         |   2 +
 vpn/vpn.h                  |  10 +-
 10 files changed, 237 insertions(+), 42 deletions(-)

-- 
2.20.1

------------------------------

Date: Thu, 17 Sep 2020 18:37:11 +0300
From: Jussi Laakkonen <[email protected]>
Subject: [PATCH 1/6] service: Expose set_split_routing() for internal
        use
To: [email protected]
Message-ID: <[email protected]>

Rename set_split_routing() to __connman_service_set_split_routing() to
be used outside service.c.
---
 src/connman.h |  2 ++
 src/service.c | 23 +++++++++++++----------
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/src/connman.h b/src/connman.h
index 3bdc0dc7..caa049bb 100644
--- a/src/connman.h
+++ b/src/connman.h
@@ -779,6 +779,8 @@ void __connman_service_set_pac(struct connman_service 
*service,
 bool __connman_service_is_hidden(struct connman_service *service);
 bool __connman_service_is_split_routing(struct connman_service *service);
 bool __connman_service_index_is_split_routing(int index);
+void __connman_service_set_split_routing(struct connman_service *service,
+                                               bool split_routing);
 int __connman_service_get_index(struct connman_service *service);
 void __connman_service_set_hidden(struct connman_service *service);
 void __connman_service_set_hostname(struct connman_service *service,
diff --git a/src/service.c b/src/service.c
index 2f497d10..eb197483 100644
--- a/src/service.c
+++ b/src/service.c
@@ -367,7 +367,8 @@ static enum connman_service_proxy_method 
string2proxymethod(const char *method)
                return CONNMAN_SERVICE_PROXY_METHOD_UNKNOWN;
 }
 
-static void set_split_routing(struct connman_service *service, bool value)
+void __connman_service_set_split_routing(struct connman_service *service,
+                                                               bool value)
 {
        if (service->type != CONNMAN_SERVICE_TYPE_VPN)
                return;
@@ -400,9 +401,10 @@ int __connman_service_load_modifiable(struct 
connman_service *service)
        case CONNMAN_SERVICE_TYPE_P2P:
                break;
        case CONNMAN_SERVICE_TYPE_VPN:
-               set_split_routing(service, g_key_file_get_boolean(keyfile,
-                                                       service->identifier,
-                                                       "SplitRouting", NULL));
+               __connman_service_set_split_routing(service,
+                                               g_key_file_get_boolean(keyfile,
+                                               service->identifier,
+                                               "SplitRouting", NULL));
 
                /* fall through */
        case CONNMAN_SERVICE_TYPE_WIFI:
@@ -456,9 +458,10 @@ static int service_load(struct connman_service *service)
        case CONNMAN_SERVICE_TYPE_P2P:
                break;
        case CONNMAN_SERVICE_TYPE_VPN:
-               set_split_routing(service, g_key_file_get_boolean(keyfile,
-                                                       service->identifier,
-                                                       "SplitRouting", NULL));
+               __connman_service_set_split_routing(service,
+                                               g_key_file_get_boolean(keyfile,
+                                               service->identifier,
+                                               "SplitRouting", NULL));
 
                autoconnect = g_key_file_get_boolean(keyfile,
                                service->identifier, "AutoConnect", &error);
@@ -4796,11 +4799,11 @@ static DBusMessage *move_service(DBusConnection *conn,
                        return __connman_error_invalid_service(msg);
                }
 
-               set_split_routing(target, true);
+               __connman_service_set_split_routing(target, true);
        } else
-               set_split_routing(target, false);
+               __connman_service_set_split_routing(target, false);
 
-       set_split_routing(service, false);
+       __connman_service_set_split_routing(service, false);
 
        target4 = __connman_ipconfig_get_method(target->ipconfig_ipv4);
        target6 = __connman_ipconfig_get_method(target->ipconfig_ipv6);
-- 
2.20.1

------------------------------

Date: Thu, 17 Sep 2020 18:37:12 +0300
From: Jussi Laakkonen <[email protected]>
Subject: [PATCH 2/6] provider: Expose split routing variable in VPN
        properties
To: [email protected]
Message-ID: <[email protected]>

Split routing variable should be known also the VPNs and exposed in the
VPN properties. Also add a function connman_provider_set_split_routing()
for plugins to be able to set the split routing value.
---
 include/provider.h |  2 ++
 src/provider.c     | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/include/provider.h b/include/provider.h
index b5856653..01b945c9 100644
--- a/include/provider.h
+++ b/include/provider.h
@@ -113,6 +113,8 @@ int connman_provider_set_nameservers(struct 
connman_provider *provider,
                                        char * const *nameservers);
 void connman_provider_set_autoconnect(struct connman_provider *provider,
                                                                bool flag);
+void connman_provider_set_split_routing(struct connman_provider *provider,
+                                                       bool split_routing);
 
 const char *connman_provider_get_driver_name(struct connman_provider 
*provider);
 const char *connman_provider_get_save_group(struct connman_provider *provider);
diff --git a/src/provider.c b/src/provider.c
index 7d663e0c..81263554 100644
--- a/src/provider.c
+++ b/src/provider.c
@@ -53,6 +53,7 @@ void __connman_provider_append_properties(struct 
connman_provider *provider,
                                                        DBusMessageIter *iter)
 {
        const char *host, *domain, *type;
+       bool split_routing = false;
 
        if (!provider->driver || !provider->driver->get_property)
                return;
@@ -61,6 +62,10 @@ void __connman_provider_append_properties(struct 
connman_provider *provider,
        domain = provider->driver->get_property(provider, "Domain");
        type = provider->driver->get_property(provider, "Type");
 
+       if (provider->vpn_service)
+               split_routing = __connman_service_is_split_routing(
+                                       provider->vpn_service);
+
        if (host)
                connman_dbus_dict_append_basic(iter, "Host",
                                        DBUS_TYPE_STRING, &host);
@@ -72,6 +77,9 @@ void __connman_provider_append_properties(struct 
connman_provider *provider,
        if (type)
                connman_dbus_dict_append_basic(iter, "Type", DBUS_TYPE_STRING,
                                                 &type);
+
+       connman_dbus_dict_append_basic(iter, "SplitRouting",
+                                       DBUS_TYPE_BOOLEAN, &split_routing);
 }
 
 struct connman_provider *
@@ -597,6 +605,16 @@ void connman_provider_set_autoconnect(struct 
connman_provider *provider,
                __connman_service_save(provider->vpn_service);
 }
 
+void connman_provider_set_split_routing(struct connman_provider *provider,
+                                                       bool split_routing)
+{
+       if (!provider || !provider->vpn_service)
+               return;
+
+       __connman_service_set_split_routing(provider->vpn_service,
+                                                               split_routing);
+}
+
 static void unregister_provider(gpointer data)
 {
        struct connman_provider *provider = data;
-- 
2.20.1

------------------------------

Date: Thu, 17 Sep 2020 18:37:13 +0300
From: Jussi Laakkonen <[email protected]>
Subject: [PATCH 3/6] vpn: Add SplitRouting to supported D-Bus
        variables
To: [email protected]
Message-ID: <[email protected]>

When adding connection check also SplitRouting value and set it
accordingly via provider. Process the SplitRouting variable also when
VPN property changes.
---
 plugins/vpn.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/plugins/vpn.c b/plugins/vpn.c
index 5668c004..e1bb0403 100644
--- a/plugins/vpn.c
+++ b/plugins/vpn.c
@@ -664,6 +664,7 @@ static void add_connection(const char *path, 
DBusMessageIter *properties,
                DBusMessageIter entry, value;
                const char *key;
                char *str;
+               dbus_bool_t value_bool;
 
                dbus_message_iter_recurse(properties, &entry);
                dbus_message_iter_get_basic(&entry, &key);
@@ -686,10 +687,12 @@ static void add_connection(const char *path, 
DBusMessageIter *properties,
                        dbus_message_iter_get_basic(&value, &str);
                        data->type = g_strdup(str);
                } else if (g_str_equal(key, "Immutable")) {
-                       dbus_bool_t immutable;
-
-                       dbus_message_iter_get_basic(&value, &immutable);
-                       data->immutable = immutable;
+                       dbus_message_iter_get_basic(&value, &value_bool);
+                       data->immutable = value_bool;
+               } else if (g_str_equal(key, "SplitRouting")) {
+                       dbus_message_iter_get_basic(&value, &value_bool);
+                       connman_provider_set_split_routing(data->provider,
+                                                               value_bool);
                } else if (g_str_equal(key, "Host")) {
                        dbus_message_iter_get_basic(&value, &str);
                        data->host = g_strdup(str);
@@ -1876,6 +1879,11 @@ static gboolean property_changed(DBusConnection *conn,
                g_free(data->domain);
                data->domain = g_strdup(str);
                connman_provider_set_domain(data->provider, data->domain);
+       } else if (g_str_equal(key, "SplitRouting")) {
+               dbus_bool_t split_routing;
+               dbus_message_iter_get_basic(&value, &split_routing);
+               connman_provider_set_split_routing(data->provider,
+                                                               split_routing);
        }
 
        if (ip_set && err == 0) {
-- 
2.20.1

------------------------------

Subject: Digest Footer

_______________________________________________
connman mailing list -- [email protected]
To unsubscribe send an email to [email protected]


------------------------------

End of connman Digest, Vol 59, Issue 15
***************************************

Reply via email to