Send connman mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.01.org/mailman/listinfo/connman
or, 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. Re: [PATCHv2 3/5] openvpn: Add support for tap devices
      (Patrik Flykt)
   2. Re: [PATCHv2 5/5] vpnc: Add support for tap devices (Patrik Flykt)
   3. [PATCH] test: Correct format specifier used in printf for int
      and unsigned int (Nishant Chaprana)
   4. Add CAP_SYS_MODULE to CapabilityBoundingSet... (Brian H. Anderson)
   5. Re: [PATCH] Add AlwaysUseFallbackNameservers flag in the
      configuration file. (wangfe-nestlabs)


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

Message: 1
Date: Mon, 29 Feb 2016 10:40:21 +0200
From: Patrik Flykt <[email protected]>
To: Hendrik Donner <[email protected]>
Cc: [email protected]
Subject: Re: [PATCHv2 3/5] openvpn: Add support for tap devices
Message-ID: <[email protected]>
Content-Type: text/plain; charset="UTF-8"


        Hi,

On Sat, 2016-02-27 at 20:38 +0100, Hendrik Donner wrote:
> Implement support for the OpenVPN.DeviceType configuration option by
> implementing the device flags function and configuring OpenVPN properly.
> 
> Signed-off-by: Hendrik Donner <[email protected]>

We don't use Signed-off-bys in ConnMan, I'd scrape it off when applying
anyway so...

> ---
>  vpn/plugins/openvpn.c | 23 ++++++++++++++++++++++-
>  1 file changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/vpn/plugins/openvpn.c b/vpn/plugins/openvpn.c
> index 9ee5795..814d635 100644
> --- a/vpn/plugins/openvpn.c
> +++ b/vpn/plugins/openvpn.c
> @@ -29,6 +29,7 @@
>  #include <unistd.h>
>  #include <stdio.h>
>  #include <net/if.h>
> +#include <linux/if_tun.h>
>  
>  #include <glib.h>
>  
> @@ -71,6 +72,7 @@ struct {
>       { "OpenVPN.CompLZO", "--comp-lzo", 0 },
>       { "OpenVPN.RemoteCertTls", "--remote-cert-tls", 1 },
>       { "OpenVPN.ConfigFile", "--config", 1 },
> +     { "OpenVPN.DeviceType", NULL, 1 },
>  };
>  
>  struct nameserver_entry {
> @@ -362,7 +364,15 @@ static int ov_connect(struct vpn_provider *provider,
>                                       connman_task_get_path(task));
>  
>       connman_task_add_argument(task, "--dev", if_name);
> -     connman_task_add_argument(task, "--dev-type", "tun");
> +     option = vpn_provider_get_string(provider, "OpenVPN.DeviceType");
> +     if (option) {
> +             connman_task_add_argument(task, "--dev-type", option);
> +     } else {
> +             /*
> +              * Default to tun for backwards compatibility.
> +              */
> +             connman_task_add_argument(task, "--dev-type", "tun");
> +     }
>  
>       connman_task_add_argument(task, "--persist-tun", NULL);
>  
> @@ -395,10 +405,21 @@ done:
>       return err;
>  }
>  
> +static int ov_device_flags(struct vpn_provider *provider)
> +{
> +     const char *tun;

Nitpick: empty line between variables and code.

> +     tun = vpn_provider_get_string(provider, "OpenVPN.DeviceType");
> +     if (tun) {
> +             return g_str_equal(tun, "tap") ? IFF_TAP : IFF_TUN;

Here it'd be better if only "tun" or "tap" were accepted with anything
else giving an error message.

> +     }

Nitpick: Empty line here too.

> +     return IFF_TUN;
> +}
> +
>  static struct vpn_driver vpn_driver = {
>       .notify = ov_notify,
>       .connect        = ov_connect,
>       .save           = ov_save,
> +     .device_flags = ov_device_flags,
>  };
>  
>  static int openvpn_init(void)


        Patrik



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

Message: 2
Date: Mon, 29 Feb 2016 10:45:52 +0200
From: Patrik Flykt <[email protected]>
To: Hendrik Donner <[email protected]>
Cc: [email protected]
Subject: Re: [PATCHv2 5/5] vpnc: Add support for tap devices
Message-ID: <[email protected]>
Content-Type: text/plain; charset="UTF-8"


        Hi,

On Sat, 2016-02-27 at 20:38 +0100, Hendrik Donner wrote:
> Implement support for the VPNC.InferfaceMode configuration option by
> implementing the device flags function and configuring VPNC properly.
> 
> Signed-off-by: Hendrik Donner <[email protected]>
> ---
> Only compile tested.
> 
>  vpn/plugins/vpnc.c | 22 +++++++++++++++++-----
>  1 file changed, 17 insertions(+), 5 deletions(-)
> 
> diff --git a/vpn/plugins/vpnc.c b/vpn/plugins/vpnc.c
> index e358d63..afe1958 100644
> --- a/vpn/plugins/vpnc.c
> +++ b/vpn/plugins/vpnc.c
> @@ -29,6 +29,7 @@
>  #include <unistd.h>
>  #include <stdio.h>
>  #include <net/if.h>
> +#include <linux/if_tun.h>
>  
>  #include <glib.h>
>  
> @@ -80,6 +81,7 @@ struct {
>       { "VPNC.SingleDES", "Enable Single DES", NULL, OPT_BOOLEAN, true },
>       { "VPNC.NoEncryption", "Enable no encryption", NULL, OPT_BOOLEAN,
>                                                                       true },
> +     { "VPNC.InterfaceMode", "Interface Mode", "tun", OPT_STRING, true },
>  };
>  
>  static int vc_notify(DBusMessage *msg, struct vpn_provider *provider)
> @@ -287,7 +289,6 @@ static int vc_connect(struct vpn_provider *provider,
>       connman_task_add_argument(task, "--no-detach", NULL);
>  
>       connman_task_add_argument(task, "--ifname", if_name);
> -     connman_task_add_argument(task, "--ifmode", "tun");
>  
>       connman_task_add_argument(task, "--script",
>                               SCRIPTDIR "/openconnect-script");
> @@ -329,11 +330,22 @@ static int vc_error_code(struct vpn_provider *provider, 
> int exit_code)
>       }
>  }

Doesn't connman_task_add_argument(task, "--ifmode", "tun"); need to be
set if there is no option specifying tun? Or is the --dev-type given as
default for openvpn in patch 3/5 unnecessary?

>  
> +static int vc_device_flags(struct vpn_provider *provider)
> +{
> +     const char *tun;

Nitpick: empty line here.

> +     tun = vpn_provider_get_string(provider, "VPNC.InterfaceMode");

This setting should be named identical after the VPNC. prefix to the one
used for openvpn in order not to confuse the user.

> +     if (tun) {
> +             return g_str_equal(tun, "tap") ? IFF_TAP : IFF_TUN;

Same strictness comment applies here too, "tun", "tap" or error.

> +     }

Nitpick: empty line would be nice here too, makes the code look lighter.

> +     return IFF_TUN;
> +}
> +
>  static struct vpn_driver vpn_driver = {
> -     .notify         = vc_notify,
> -     .connect        = vc_connect,
> -     .error_code     = vc_error_code,
> -     .save           = vc_save,
> +     .notify           = vc_notify,
> +     .connect          = vc_connect,
> +     .error_code       = vc_error_code,
> +     .save             = vc_save,
> +     .device_flags = vc_device_flags,
>  };
>  
>  static int vpnc_init(void)

Otherwise looks fine, thanks!

   Patrik



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

Message: 3
Date: Mon, 29 Feb 2016 17:23:27 +0530
From: Nishant Chaprana <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: [PATCH] test: Correct format specifier used in printf for int
        and unsigned int
Message-ID: <[email protected]>

---
 tools/addr-test.c  | 2 +-
 tools/stats-tool.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/addr-test.c b/tools/addr-test.c
index 273ab02..5d53fa7 100644
--- a/tools/addr-test.c
+++ b/tools/addr-test.c
@@ -59,7 +59,7 @@ int main(int argc, char *argv[])
        for (i = 0; i < 4; i++) {
                len = (i + 1) * 8;
                addr.s_addr = htonl(~(0xfffffffflu >> len));
-               printf("prefixlen %-2u  netmask %s\n", len, inet_ntoa(addr));
+               printf("prefixlen %-2d  netmask %s\n", len, inet_ntoa(addr));
        }
 
        return 0;
diff --git a/tools/stats-tool.c b/tools/stats-tool.c
index b076478..f773413 100644
--- a/tools/stats-tool.c
+++ b/tools/stats-tool.c
@@ -277,9 +277,9 @@ static void stats_hdr_info(struct stats_file *file)
                get_index(file, begin), hdr->begin);
        printf("  end             [%d] 0x%08x\n",
                get_index(file, end), hdr->end);
-       printf("  home            [%d] 0x%08x\n",
+       printf("  home            [%u] 0x%08x\n",
                home_idx, hdr->home);
-       printf("  roaming         [%d] 0x%08x\n\n",
+       printf("  roaming         [%u] 0x%08x\n\n",
                roaming_idx, hdr->roaming);
 
 
-- 
1.9.1



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

Message: 4
Date: Mon, 29 Feb 2016 10:02:42 -0800
From: "Brian H. Anderson" <[email protected]>
To: [email protected]
Subject: Add CAP_SYS_MODULE to CapabilityBoundingSet...
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8; format=flowed

I'm running connmand 1.31 on a 4.1.18 kernel started using systemd 215.

When attempting to establish a wifi tether, connman fails since it 
cannot load the required kernel modules (iptables_init/iptables.c). 
Adding CAP_SYS_MODULE to the systemd unit file CapabilityBoundingSet 
declaration appears to fix the problem.

ba



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

Message: 5
Date: Mon, 29 Feb 2016 10:07:20 -0800
From: wangfe-nestlabs <[email protected]>
To: Patrik Flykt <[email protected]>
Cc: [email protected], Grant Erickson <[email protected]>
Subject: Re: [PATCH] Add AlwaysUseFallbackNameservers flag in the
        configuration file.
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8

Hi Patrik,

The device only supports wifi service.  The DNS servers got from ISP through 
DHCP is flaky.  To make DNS work better,  user can specify some backup DNS 
servers.
And this feature is configurable, by default it is turned off.  Only some users 
experienced such problem can turn it on.

Thanks,

Feng

  

> On Feb 28, 2016, at 11:27 PM, Patrik Flykt <[email protected]> 
> wrote:
> 
> 
>       Hi,
> 
> On Fri, 2016-02-26 at 07:52 -0800, Grant Erickson wrote:
>> It?s easy to see how this is done one-off, statically for a provision
>> or via a per-service-specific configuration setting using
>> Nameservers.Configuration.
>> 
>> However, what?s the recommended way to ensure that nameservers can be
>> configured, via Nameservers.Configuration, and applied to all
>> services, without regard to their technology type or the service name?
>> 
>> The use case here is that a particular ISP supplies DNS servers in
>> DHCP. However, their DNS servers are notoriously flaky and
>> non-responsive (i.e. failed average response rate is high).
>> Consequently, given how conman?s DNS proxy functions,
>> statically-configured servers are a stopgap guarantee that will work
>> even when the DHCP-provided servers do not.
> 
> So your use case actually continues that all services on the device end
> up using the same ISP and it's flaky DNS servers, right?
> 
> Usually different WiFi, ethernet and cellular serivces end up using
> different ISPs and therefore different DNS servers, leaving only a
> subset of the services to be of the flaky kind. For these the option is
> to configure them a priori through .config files or after empirical
> evidence via D-Bus, as you pointed out.
> 
> Cheers,
> 
>       Patrik
> 



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

Subject: Digest Footer

_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman


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

End of connman Digest, Vol 4, Issue 38
**************************************

Reply via email to