[Openvpn-devel] Fixed that "--bind ipv6only" did not work due to incorrect parameter processing. It seems that "ipv6only" did not work from the beginning.

Message ID 20170928031620.22331-1-hashiz@meridiani.jp
State Accepted
Headers show
Series
  • [Openvpn-devel] Fixed that "--bind ipv6only" did not work due to incorrect parameter processing. It seems that "ipv6only" did not work from the beginning.
Related show

Commit Message

hashiz Sept. 28, 2017, 3:16 a.m.
---
 src/openvpn/options.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Gert Doering Sept. 30, 2017, 10:34 a.m. | #1
ACK, thanks.

I have modified the commit message to refer to the commit that broke this,
and added a short first line (which is what shows up in "git shortlog",
so you want this to be less than ~60-70 charcters, not multilien).

Your patch has been applied to the master and release/2.4 branch.

commit cdeba63ca3a9e5c765edecd11745e9e2cc1b945d (master)
commit b0ef0003c554db34f5623a920874c97b22bc0224 (release/2.4)
Author: hashiz <hashiz@meridiani.jp>
Date:   Thu Sep 28 12:16:20 2017 +0900

    Fix '--bind ipv6only'
    
    Commit 3d6a4cded2b20fb81 introduced checking for "too many parameters"
    at option processing, and neglected to take "ipv6only" as possible
    (and optional) argument to "--bind" into account.
    
    Trac: #938

    Acked-by: Gert Doering <gert@greenie.muc.de>
    Message-Id: <20170928031620.22331-1-hashiz@meridiani.jp>
    URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15522.html
    Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot

Patch

diff --git a/src/openvpn/options.c b/src/openvpn/options.c
index 3a5bccfc..5f31e7eb 100644
--- a/src/openvpn/options.c
+++ b/src/openvpn/options.c
@@ -5881,7 +5881,7 @@  add_option(struct options *options,
         VERIFY_PERMISSION(OPT_P_GENERAL|OPT_P_CONNECTION);
         options->ce.remote_port = p[1];
     }
-    else if (streq(p[0], "bind") && !p[1])
+    else if (streq(p[0], "bind") && !p[2])
     {
         VERIFY_PERMISSION(OPT_P_GENERAL|OPT_P_CONNECTION);
         options->ce.bind_defined = true;