From d532074ef5e80268a9529002ca7f233eb2730ff6 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 27 May 2018 05:24:07 +0200 Subject: [PATCH] wg-quick: freebsd: configure as p2p link Signed-off-by: Jason A. Donenfeld --- src/wg-quick/freebsd.bash | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/wg-quick/freebsd.bash b/src/wg-quick/freebsd.bash index d9a0b03..40dc3f1 100755 --- a/src/wg-quick/freebsd.bash +++ b/src/wg-quick/freebsd.bash @@ -146,9 +146,11 @@ up_if() { } add_addr() { - local family=inet - [[ $1 == *:* ]] && family=inet6 - cmd ifconfig "$INTERFACE" "$family" "$1" alias + if [[ $1 == *:* ]]; then + cmd ifconfig "$INTERFACE" inet6 "$1" alias + else + cmd ifconfig "$INTERFACE" inet "$1" "${1%%/*}" alias + fi } set_mtu() {