wireguard.lists.zx2c4.com archive mirror
 help / color / mirror / Atom feed
From: Ronan Pigott <rpigott314@gmail.com>
To: wireguard@lists.zx2c4.com
Cc: Ronan Pigott <rpigott@berkeley.edu>
Subject: [PATCH v2] wg-quick: linux: Don't fail systemd service when using systemd-resolved
Date: Tue, 27 Aug 2019 18:42:14 -0700	[thread overview]
Message-ID: <20190828014214.12289-1-rpigott@berkeley.edu> (raw)

From: Ronan Pigott <rpigott@berkeley.edu>

v2 patch for systemd-resolved support.

systemd-resolved has a compatibility interface for use with resolvconf
scripts when resolvectl is called from a symlink from resolvconf.
However, when tearing down the interface, cmd_down calls del_if and
then unset_dns. In the case of systemd-resolved, deleting the interface
also removes the systemd-resolved entry and causes resolvconf -d to fail
when resolvconf really is a symlink to resolvectl. This causes
`wg-quick down` and 'wg-quick@.service' to exit with failure.

This version uses the resolvconf '-f' flag to ignore non existent
interfaces, supported by both openresolv and sd-resolved resolvconf.

See v1 for the symlink test method and discussion.

Signed-off-by: Ronan Pigott <rpigott@berkeley.edu>
---
 src/tools/wg-quick/linux.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tools/wg-quick/linux.bash b/src/tools/wg-quick/linux.bash
index 2f36dee..e218be2 100755
--- a/src/tools/wg-quick/linux.bash
+++ b/src/tools/wg-quick/linux.bash
@@ -155,7 +155,7 @@ set_dns() {
 
 unset_dns() {
 	[[ ${#DNS[@]} -gt 0 ]] || return 0
-	cmd resolvconf -d "$(resolvconf_iface_prefix)$INTERFACE"
+	cmd resolvconf -fd "$(resolvconf_iface_prefix)$INTERFACE"
 }
 
 add_route() {
-- 
2.23.0

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

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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-28  1:42 Ronan Pigott [this message]
2019-08-28  2:30 ` [PATCH v2] wg-quick: linux: Don't fail systemd service when using systemd-resolved Jason A. Donenfeld

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=20190828014214.12289-1-rpigott@berkeley.edu \
    --to=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).