From: Colin Finck <mail@colinfinck.de>
To: wireguard@lists.zx2c4.com
Subject: [PATCH] wg-quick: Unset the DNS first, then delete the WireGuard interface.
Date: Thu, 14 Mar 2019 12:56:12 +0100 [thread overview]
Message-ID: <20190314115612.2412-1-mail@colinfinck.de> (raw)
This prevents an "Unknown interface 'wg0': No such device" error on the command line.
Signed-off-by: Colin Finck <mail@colinfinck.de>
---
src/tools/wg-quick/freebsd.bash | 2 +-
src/tools/wg-quick/linux.bash | 2 +-
src/tools/wg-quick/openbsd.bash | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/tools/wg-quick/freebsd.bash b/src/tools/wg-quick/freebsd.bash
index e83dbef..3b2d95b 100755
--- a/src/tools/wg-quick/freebsd.bash
+++ b/src/tools/wg-quick/freebsd.bash
@@ -420,8 +420,8 @@ cmd_down() {
[[ " $(wg show interfaces) " == *" $INTERFACE "* ]] || die "\`$INTERFACE' is not a WireGuard interface"
execute_hooks "${PRE_DOWN[@]}"
[[ $SAVE_CONFIG -eq 0 ]] || save_config
- del_if
unset_dns
+ del_if
execute_hooks "${POST_DOWN[@]}"
}
diff --git a/src/tools/wg-quick/linux.bash b/src/tools/wg-quick/linux.bash
index 84643c4..d3d4fb0 100755
--- a/src/tools/wg-quick/linux.bash
+++ b/src/tools/wg-quick/linux.bash
@@ -295,8 +295,8 @@ cmd_down() {
[[ " $(wg show interfaces) " == *" $INTERFACE "* ]] || die "\`$INTERFACE' is not a WireGuard interface"
execute_hooks "${PRE_DOWN[@]}"
[[ $SAVE_CONFIG -eq 0 ]] || save_config
- del_if
unset_dns
+ del_if
execute_hooks "${POST_DOWN[@]}"
}
diff --git a/src/tools/wg-quick/openbsd.bash b/src/tools/wg-quick/openbsd.bash
index 9996162..d701ae1 100755
--- a/src/tools/wg-quick/openbsd.bash
+++ b/src/tools/wg-quick/openbsd.bash
@@ -414,8 +414,8 @@ cmd_down() {
fi
execute_hooks "${PRE_DOWN[@]}"
[[ $SAVE_CONFIG -eq 0 ]] || save_config
- del_if
unset_dns
+ del_if
execute_hooks "${POST_DOWN[@]}"
}
--
2.17.1.windows.2
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard
next reply other threads:[~2019-03-20 22:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-14 11:56 Colin Finck [this message]
2019-03-20 22:55 ` Jason A. Donenfeld
2019-03-21 7:32 ` Colin Finck
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=20190314115612.2412-1-mail@colinfinck.de \
--to=mail@colinfinck.de \
--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).