]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Fix --disable-ipv6 option
authorDavid Woodhouse <dwmw2@infradead.org>
Sun, 11 Apr 2021 17:02:39 +0000 (18:02 +0100)
committerDaniel Lenski <dlenski@gmail.com>
Mon, 12 Apr 2021 18:00:14 +0000 (11:00 -0700)
Commit 7e2129f8a9 ("ensure that openconnect_disable_{dtls,ipv6} do
nothing if vpninfo has ever been connected") added a check to disallow
setting this... if it wasn't already set, OR the connection had
previously been established. Which seems wrong; I think that was
supposed to have been *AND*.

Not that I object very much to this not working, a whole quarter of a
century after RFC1883 was published. But I wanted to use it for testing
PPP negotiation, and it wasn't working.

Signed-off-by: David Woodhouse <dwmw2@infradead.org>
library.c

index 4aca1d593a94cd0a7cb98c4a99ecdaff3fd84e9d..fd499207790619cfdd254e39bff27bf9805f4d76 100644 (file)
--- a/library.c
+++ b/library.c
@@ -626,8 +626,8 @@ int openconnect_disable_ipv6(struct openconnect_info *vpninfo)
         * unconfigured state. (Neither a closed TLS socket
         * nor tunnel socket is a reliable indicator.)
         */
-       if (!vpninfo->disable_ipv6
-           || vpninfo->ssl_times.last_tx != 0)
+       if (!vpninfo->disable_ipv6 &&
+           vpninfo->ssl_times.last_tx != 0)
                return -EINVAL;
        vpninfo->disable_ipv6 = 1;
        return 0;