wireguard.lists.zx2c4.com archive mirror
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Ronan Pigott <rpigott314@gmail.com>
Cc: Ronan Pigott <rpigott@berkeley.edu>,
	WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: [PATCH] wg-quick: linux: Don't fail systemd service when using systemd-resolved
Date: Tue, 27 Aug 2019 20:20:38 -0600	[thread overview]
Message-ID: <CAHmME9q6hQfrQK_1pRB=tbtJ_Sn=-3Z=8v_ZJW7uB6UuxDx15Q@mail.gmail.com> (raw)
In-Reply-To: <BWKVAQQ0RFKJ.2FBG8FY1MXOR1@rxps>

Hi Ronan,

On Tue, Aug 27, 2019 at 7:21 PM Ronan Pigott <rpigott314@gmail.com> wrote:
> Yeah that was my first thought, then I supposed that perhaps it was
> ordered that way intentionally to prevent a situation where the dns is
> unset and a client would make a dns lookup on the interface before it is
> deleted. It would use the sd-resolved 'global' configured dns servers in
> that case which is maybe undesired.

Right, exactly.

> I realize it's a hack. I gave the explanation somewhat in the hope
> someone had a better solution to the problem I was experiencing.

One approach to the hack would be to just take it all the way and
append `|| true`. That is, make it non-fatal. A tear down routine,
anyway, has very few choices on what to do when something goes wrong,
and sometimes continuing isn't such a bad policy.

> The real issue here is that there are there are three common
> implementations of resolvconf: debian resolvconf, openresolv, and
> sd-resolved compat interface. So wg-quick uses resolvconf, but is only
> fully compatible with openresolv. wg-quick is (accidentally) compatible
> with sd-resolved through the resolvconf compat interface, except for
> this minor hiccup. This hack allows wg-quick to work for both methods
> with no extra configuration from the user, no alternative code path
> for sd-resolved, and no change in behavior for non sd-resolved users.

"wg-quick is (accidentally) compatible with sd-resolved" That's
actually not totally true. Systemd has that resolvconf compat
interface because I annoyed Lennart about it a bunch. :-P

> There is another way that is might be more palatable: openresolv and
> sd-resolved resolvconf both support a '-f' flag for ignoring missing
> interfaces, which neatly sidesteps this error. However, I don't think
> debian's resolvconf supports this flag. Now that I look into it though,
> it seems debian's resolvconf does not support '-l' either, which wg-quick
> uses, so maybe we don't care to support this anyway. I think v2 will
> just use the flag instead, if that's alright.

Yes, that's terrific. If I recall correctly, Debian's resolvconf will
ignore arguments it doesn't understand if they're in the right
position. It seems, anyhow, that -f is exactly what we should be
using. I'll gladly merge a signed-off-by v2 that adds it.

> Users of openvpn use sd-resolved dbus interface in place of resolvconf,
> such as seen here: https://github.com/jonathanio/update-systemd-resolved
> but I believe this is overkill for wg-quick.

Ahhh yes the amazing shell-script IPv6 parser. I recall reading this
in wonder a few years ago. Indeed it's a bit "much" for wg-quick, and
I think your solution of adding -f to resolvconf is a good approach.

Jason
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

      reply	other threads:[~2019-08-28  2:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-24  7:14 [PATCH] wg-quick: linux: Don't fail systemd service when using systemd-resolved Ronan Pigott
2019-08-27 22:51 ` Jason A. Donenfeld
2019-08-28  1:21   ` Ronan Pigott
2019-08-28  2:20     ` Jason A. Donenfeld [this message]

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='CAHmME9q6hQfrQK_1pRB=tbtJ_Sn=-3Z=8v_ZJW7uB6UuxDx15Q@mail.gmail.com' \
    --to=jason@zx2c4.com \
    --cc=rpigott314@gmail.com \
    --cc=rpigott@berkeley.edu \
    --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).