From: Brassy Panache <brassy.panache@gmail.com>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: wireguard@lists.zx2c4.com
Subject: Re: Error with wg-quick down when IPv6 not present
Date: Wed, 25 Sep 2019 19:30:13 +1000 [thread overview]
Message-ID: <CAJLOqRy8Tg6E_B_riiRK_zXvfAFCmZ4Qdj9U5AAEdGMRrgeZag@mail.gmail.com> (raw)
In-Reply-To: <20190925092541.GA8039@zx2c4.com>
[-- Attachment #1.1: Type: text/plain, Size: 2193 bytes --]
I've just tested your patch and that works! I no longer see the errors. I
don't have a IPv6 environment to test with at the moment, so I cannot
verify that case.
On Wed, Sep 25, 2019 at 7:25 PM Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> On Wed, Sep 25, 2019 at 11:06:18AM +1000, Brassy Panache wrote:
> > I have a kernel without IPv6 support. I've noticed when running:
> >
> > $ wg-quick down vpn
> >
> >
> > I receive the following errors:
> >
> > [#] ip -4 rule delete table 51820
> > [#] ip -4 rule delete table main suppress_prefixlength 0
> > RTNETLINK answers: Address family not supported by protocol
> > Dump terminated
> > RTNETLINK answers: Address family not supported by protocol
> > Dump terminated
> > [#] ip link delete dev vpn
> > [#] resolvconf -d vpn -f
> >
> >
> > This is caused by the assumption that the command:
> >
> > $ ip -6 rule show
> >
> >
> > will run on the system. I have made a change to my local wg-quick script
> > which first tests if the command runs successfully before it clears the
> > rules. The same should probably also be done prior to running the IPv4
> > version of the command.
>
> Would this work?
>
> diff --git a/src/tools/wg-quick/linux.bash b/src/tools/wg-quick/linux.bash
> index e690944d..612ecd77 100755
> --- a/src/tools/wg-quick/linux.bash
> +++ b/src/tools/wg-quick/linux.bash
> @@ -102,10 +102,10 @@ del_if() {
> while [[ $(ip -4 rule show) == *"from all lookup main
> suppress_prefixlength 0"* ]]; do
> cmd ip -4 rule delete table main
> suppress_prefixlength 0
> done
> - while [[ $(ip -6 rule show) == *"lookup $table"* ]]; do
> + while [[ $(ip -6 rule show 2>/dev/null) == *"lookup
> $table"* ]]; do
> cmd ip -6 rule delete table $table
> done
> - while [[ $(ip -6 rule show) == *"from all lookup main
> suppress_prefixlength 0"* ]]; do
> + while [[ $(ip -6 rule show 2>/dev/null) == *"from all
> lookup main suppress_prefixlength 0"* ]]; do
> cmd ip -6 rule delete table main
> suppress_prefixlength 0
> done
> fi
>
>
[-- Attachment #1.2: Type: text/html, Size: 2865 bytes --]
[-- Attachment #2: Type: text/plain, Size: 148 bytes --]
_______________________________________________
WireGuard mailing list
WireGuard@lists.zx2c4.com
https://lists.zx2c4.com/mailman/listinfo/wireguard
prev parent reply other threads:[~2019-11-27 9:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-25 1:06 Error with wg-quick down when IPv6 not present Brassy Panache
2019-09-25 9:25 ` Jason A. Donenfeld
2019-09-25 9:30 ` Brassy Panache [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=CAJLOqRy8Tg6E_B_riiRK_zXvfAFCmZ4Qdj9U5AAEdGMRrgeZag@mail.gmail.com \
--to=brassy.panache@gmail.com \
--cc=Jason@zx2c4.com \
--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).