WireGuard Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v2] wg-quick: linux: Don't fail systemd service when using systemd-resolved
@ 2019-08-28  1:42 Ronan Pigott
  2019-08-28  2:30 ` Jason A. Donenfeld
  0 siblings, 1 reply; 2+ messages in thread
From: Ronan Pigott @ 2019-08-28  1:42 UTC (permalink / raw)
  To: wireguard; +Cc: Ronan Pigott

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] wg-quick: linux: Don't fail systemd service when using systemd-resolved
  2019-08-28  1:42 [PATCH v2] wg-quick: linux: Don't fail systemd service when using systemd-resolved Ronan Pigott
@ 2019-08-28  2:30 ` Jason A. Donenfeld
  0 siblings, 0 replies; 2+ messages in thread
From: Jason A. Donenfeld @ 2019-08-28  2:30 UTC (permalink / raw)
  To: Ronan Pigott; +Cc: Ronan Pigott, WireGuard mailing list

On Tue, Aug 27, 2019 at 8:25 PM Ronan Pigott <rpigott314@gmail.com> wrote:
>
> From: Ronan Pigott <rpigott@berkeley.edu>
>
> v2 patch for systemd-resolved support.

Thanks! Merged here with one minor change:
https://git.zx2c4.com/WireGuard/commit/?id=e5a754ec46737ae12436b5ce47f6fd9d613049e1
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-28  1:42 [PATCH v2] wg-quick: linux: Don't fail systemd service when using systemd-resolved Ronan Pigott
2019-08-28  2:30 ` Jason A. Donenfeld

WireGuard Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/wireguard/0 wireguard/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 wireguard wireguard/ https://lore.kernel.org/wireguard \
		wireguard@lists.zx2c4.com zx2c4-wireguard@archiver.kernel.org
	public-inbox-index wireguard


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/com.zx2c4.lists.wireguard


AGPL code for this site: git clone https://public-inbox.org/ public-inbox