Skip to contentSkip to conversation

wg-quick: Fix alternate routing table syntax on OpenBSD

PATCH Superseded Ankur Kothari 3 participants 6 messages Aug 5, 2019 – Aug 7, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wg-quick: Fix alternate routing table syntax on OpenBSD

---
 src/tools/wg-quick/openbsd.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/tools/wg-quick/openbsd.bash +1 -1
index b234609..2cadeec 100755
@@ -293,7 +293,7 @@ add_route() {
 	fi
 
 	if [[ -n $TABLE && $TABLE != auto ]]; then
-		cmd route -q -n add "-$family" -rdomain "$TABLE" "$1" -iface "$ifaceroute"
+		cmd route -q -n -T "$TABLE" add "-$family" "$1" -iface "$ifaceroute"
 	elif [[ $1 == */0 ]]; then
 		if [[ $1 == *:* ]]; then
 			AUTO_ROUTE6=1
Signature · 8 lines
2.22.0


Sent via Migadu.com, world's easiest email hosting
_______________________________________________
WireGuard mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/wireguard
#2 lore raw

According to "man route" on openbsd, the -T is how its supposed to be run:

The other commands relating to adding, changing, or deleting routes
have

the syntax:

*route* [*-dnqtv*] [*-T* rtable] *add* [modifiers] destination gateway

The manpage for "route" doesn't even contain "rdomain" so I would assume Ankur is correct in that diff.

Den mån 5 aug. 2019 kl 20:47 skrev Jason A. Donenfeld <[email protected]>:

Quoted 13 lines

Hi Ankur,

Thanks for this. Could you provide your Signed-off-by line? Also, why is this required? Is this a recent change in syntax? A new syntax? Was the syntax always wrong? What's the deal?

Thanks,
Jason
_______________________________________________
WireGuard mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/wireguard

Signature · 1 line
May the most significant bit of your life be positive.

_______________________________________________
WireGuard mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/wireguard

#4 lore raw

PATCH v2 1/1 wg-quick: openbsd: fix alternate routing table syntax

In reply to Jason A. Donenfeld

route(8) has always used the -T option to specify the routing table; there is no rdomain option.

---
 src/tools/wg-quick/openbsd.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/tools/wg-quick/openbsd.bash +1 -1
index b234609..2cadeec 100755
@@ -293,7 +293,7 @@ add_route() {
 	fi
 
 	if [[ -n $TABLE && $TABLE != auto ]]; then
-		cmd route -q -n add "-$family" -rdomain "$TABLE" "$1" -iface "$ifaceroute"
+		cmd route -q -n -T "$TABLE" add "-$family" "$1" -iface "$ifaceroute"
 	elif [[ $1 == */0 ]]; then
 		if [[ $1 == *:* ]]; then
 			AUTO_ROUTE6=1
Signature · 8 lines
2.22.0


Sent via Migadu.com, world's easiest email hosting
_______________________________________________
WireGuard mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/wireguard