Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Daniel Lenski <dlenski@gmail.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>,
	WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: Duplicate IP address, and permissions problems on Windows
Date: Thu, 8 Apr 2021 09:09:46 -0700	[thread overview]
Message-ID: <CAOw_LSF_8x6zyDuus0dyJRnSADmf1DSPWjOBsN2-ddp+eTpUrg@mail.gmail.com> (raw)
In-Reply-To: <5D336E0F-1A42-4692-8597-6A035C4FA699@infradead.org>

On Thu, Apr 8, 2021 at 1:46 AM David Woodhouse <dwmw2@infradead.org> wrote:
> Unless netsh will do it for us when we ask *it* to set the IP address? OpenConnect doesn't normally bother itself with administrivia like setting IP addresses; its job is to pass packets.

I'm afraid not. I tried playing around with various documented and
undocumented options to netsh, and did not found a way to get it to
set an IP address which is a duplicate of another adapter's address.
That's puzzling since it IS POSSIBLE to set a duplicate IP address
(conflicting with a down adapter) via the Control Panel GUI.

I gave up and asked for any hints on StackExchange:
https://serverfault.com/questions/1059221/using-netsh-interface-ip-set-address-to-override-another-adapters-address

> I preserved it in the first cut of Wintun support because the existing vpnc-script for Windows actually depends on it... but purely for waiting for the interface to come up. Can we ditch that, let the script set the address for us, and forget we ever saw that O(n²) code because netsh handles the conflicting interfaces for us?

One way we could move this IP-reclaiming code out of OpenConnect
itself would be to make the script do it. However, this would still be
an O(n^2) loop, and it would involve parsing the text output of netsh
or similar… which will get pretty ugly very fast.

(Either that or someone figures out a/the magical option that allows
netsh to handle this itself.)

  reply	other threads:[~2021-04-10 14:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-06 11:29 David Woodhouse
2021-04-07  0:17 ` Jason A. Donenfeld
2021-04-07  8:18   ` David Woodhouse
2021-04-07 23:05     ` Daniel Lenski
2021-04-12 17:50       ` Jason A. Donenfeld
2021-04-07 23:00   ` Daniel Lenski
2021-04-08  8:46     ` David Woodhouse
2021-04-08 16:09       ` Daniel Lenski [this message]
2021-04-08 16:59     ` David Woodhouse
2021-04-08 17:53       ` Daniel Lenski
2021-04-10  9:25         ` David Woodhouse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAOw_LSF_8x6zyDuus0dyJRnSADmf1DSPWjOBsN2-ddp+eTpUrg@mail.gmail.com \
    --to=dlenski@gmail.com \
    --cc=Jason@zx2c4.com \
    --cc=dwmw2@infradead.org \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).