wg-quick: better removal of suppress_prefix rule

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2017-01-11 00:29:58 +01:00
parent 396dc76a04
commit 035a649641
1 changed files with 1 additions and 1 deletions

View File

@ -80,7 +80,7 @@ add_if() {
del_if() {
if [[ $(ip route show table all) =~ .*\ dev\ $INTERFACE\ table\ ([0-9]+)\ .* ]]; then
cmd ip rule delete table "${BASH_REMATCH[1]}"
cmd ip rule delete table main suppress_prefixlength 0 2>/dev/null
[[ $(ip rule show table main) == *"from all lookup main suppress_prefixlength 0"* ]] && cmd ip rule delete table main suppress_prefixlength 0
fi
cmd ip link delete dev "$INTERFACE"
}