summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2018-02-20 12:44:28 +0000
committermpi <mpi@openbsd.org>2018-02-20 12:44:28 +0000
commitcb31e4d9dd4ca9775b4b053871ce8112559d8522 (patch)
tree412ded5a9a410f3b80084b509feadeaaca9fd271
parentRemoving an RTF_CLONING route entry should not invalidate an RTF_CACHED (diff)
downloadwireguard-openbsd-cb31e4d9dd4ca9775b4b053871ce8112559d8522.tar.xz
wireguard-openbsd-cb31e4d9dd4ca9775b4b053871ce8112559d8522.zip
Test that removing a mpath RTF_CLONING route entry do not remove the
RTF_CACHED entry of a sibling RTF_CLONING entry.
-rw-r--r--regress/sbin/route/Makefile19
-rw-r--r--regress/sbin/route/rttest33.ok13
2 files changed, 31 insertions, 1 deletions
diff --git a/regress/sbin/route/Makefile b/regress/sbin/route/Makefile
index d34e6973d23..f6dcf05a7f6 100644
--- a/regress/sbin/route/Makefile
+++ b/regress/sbin/route/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.28 2018/02/19 11:37:38 mpi Exp $
+# $OpenBSD: Makefile,v 1.29 2018/02/20 12:44:28 mpi Exp $
RDOMAIN?= 5
@@ -378,6 +378,23 @@ rttest${n}:
sed -e "s,link\#[0-9 ]*U,link# U," | \
diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin
+# Check that removing a RTF_CLONING route do not remove RTF_CACHED children
+# from another cloning route.
+n= 33
+RTTEST_TARGETS+:=rttest${n}
+rttest${n}:
+ # Use vether(4) because we need IFT_ETHER interfaces
+ # for the auto-magic RTF_CLONING routes.
+ ${SUDO} ifconfig vether99 rdomain ${RDOMAIN} lladdr fe:e1:ba:d4:c8:1d up
+ ${SUDO} ifconfig vether99 192.168.178.52/24
+ ${SUDO} ifconfig vether99 alias 192.168.178.53/24
+ ${RCMD} add default 192.168.178.1
+ # Remove the alias
+ ${SUDO} ifconfig vether99 192.168.178.53 delete
+ ${RCMD} show -inet 2>&1 | \
+ sed -e "s,link\#[0-9 ]*U,link# U," | \
+ diff -u ${.CURDIR}/${.TARGET}.ok /dev/stdin
+
REGRESS_TARGETS=netmask ${RTTEST_TARGETS}
REGRESS_ROOT_TARGETS=${REGRESS_TARGETS}
.PHONY: ${REGRESS_TARGETS}
diff --git a/regress/sbin/route/rttest33.ok b/regress/sbin/route/rttest33.ok
new file mode 100644
index 00000000000..bf5242f06dc
--- /dev/null
+++ b/regress/sbin/route/rttest33.ok
@@ -0,0 +1,13 @@
+Routing tables
+
+Internet:
+Destination Gateway Flags Refs Use Mtu Prio Iface
+default 192.168.178.1 UGS 0 0 - 8 vether99
+192.0.2.1 192.0.2.1 UHl 0 0 32768 1 lo10001
+192.0.2.2 192.0.2.2 UHl 0 0 32768 1 lo10002
+192.0.2.3 192.0.2.3 UHl 0 0 32768 1 lo10003
+192.0.2.4 192.0.2.4 UHl 0 0 32768 1 lo10004
+192.168.178/24 192.168.178.52 UCn 1 1 - 4 vether99
+192.168.178.1 link# UHLch 1 3 - 3 vether99
+192.168.178.52 fe:e1:ba:d4:c8:1d UHLl 0 0 - 1 vether99
+192.168.178.255 192.168.178.52 UHb 0 0 - 1 vether99