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. [PATCH] l2tp: Save 'exclusive' config value in lns context
      (Jussi Laakkonen)


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

Date: Fri, 25 Oct 2019 11:24:30 +0300
From: Jussi Laakkonen <[email protected]>
Subject: [PATCH] l2tp: Save 'exclusive' config value in lns context
To: [email protected]
Message-ID: <[email protected]>

The config value 'exclusive' must be saved in lns context. This is
because if written to lac context parsing will fail (versions 1.3.8 and
1.3.14 were tested):
xl2tpd[]: parse_config: line 12: 'exclusive' not valid in this context

This went undetected unless the option was set. By default, 'exclusive'
is not written to xl2tpd config. The xl2tpd documentation states that
"Most of those described in the LNS section may be used in a LAC
context, where it make common sense (essentially l2tp procotols tuning
flags and authentication / ppp related ones)."

Added a enum option OPT_L2LNS for defining other options to be used in
lns context only.
---
 vpn/plugins/l2tp.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/vpn/plugins/l2tp.c b/vpn/plugins/l2tp.c
index ff5f08b9..422d6782 100644
--- a/vpn/plugins/l2tp.c
+++ b/vpn/plugins/l2tp.c
@@ -65,6 +65,7 @@ enum {
        OPT_L2G = 2,
        OPT_L2  = 3,
        OPT_PPPD = 4,
+       OPT_L2LNS = 5,
 };
 
 struct {
@@ -83,7 +84,7 @@ struct {
        { "L2TP.DefaultRoute", "defaultroute", OPT_L2, NULL, OPT_STRING },
        { "L2TP.FlowBit", "flow bit", OPT_L2, NULL, OPT_STRING },
        { "L2TP.TunnelRWS", "tunnel rws", OPT_L2, NULL, OPT_STRING },
-       { "L2TP.Exclusive", "exclusive", OPT_L2, NULL, OPT_STRING },
+       { "L2TP.Exclusive", "exclusive", OPT_L2LNS, NULL, OPT_STRING },
        { "L2TP.Autodial", "autodial", OPT_L2, "yes", OPT_STRING },
        { "L2TP.Redial", "redial", OPT_L2, "yes", OPT_STRING },
        { "L2TP.RedialTimeout", "redial timeout", OPT_L2, "10", OPT_STRING },
@@ -454,6 +455,9 @@ static int l2tp_write_config(struct vpn_provider *provider,
        l2tp_write_option(fd, "[global]", NULL);
        l2tp_write_fields(provider, fd, OPT_L2G);
 
+       l2tp_write_option(fd, "[lns]", NULL);
+       l2tp_write_fields(provider, fd, OPT_L2LNS);
+
        l2tp_write_option(fd, "[lac l2tp]", NULL);
 
        option = vpn_provider_get_string(provider, "Host");
-- 
2.20.1

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

Subject: Digest Footer

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


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

End of connman Digest, Vol 48, Issue 32
***************************************

Reply via email to