Test that removing a mpath RTF_CLONING route entry do not remove the
authormpi <mpi@openbsd.org>
Tue, 20 Feb 2018 12:44:28 +0000 (12:44 +0000)
committermpi <mpi@openbsd.org>
Tue, 20 Feb 2018 12:44:28 +0000 (12:44 +0000)
RTF_CACHED entry of a sibling RTF_CLONING entry.

regress/sbin/route/Makefile
regress/sbin/route/rttest33.ok [new file with mode: 0644]

index d34e697..f6dcf05 100644 (file)
@@ -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 (file)
index 0000000..bf5242f
--- /dev/null
@@ -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