-# $OpenBSD: Makefile,v 1.17 2022/04/29 11:59:10 bluhm Exp $
+# $OpenBSD: Makefile,v 1.18 2022/04/29 17:27:37 bluhm Exp $
SUBDIR += etherip gif loop
SUBDIR += pf_divert pf_forward pf_fragment pf_opts pf_print pf_state
SUBDIR += pf_table
-SUBDIR += pflog pflow rdomains rtable vxlan wg
+SUBDIR += pair pflog pflow rdomains rtable vxlan wg
.include <bsd.subdir.mk>
-# $OpenBSD: Makefile,v 1.6 2021/07/06 11:26:47 bluhm Exp $
+# $OpenBSD: Makefile,v 1.7 2022/04/29 17:27:37 bluhm Exp $
# Copyright (c) 2018-2020 Alexander Bluhm <bluhm@openbsd.org>
#
@echo SKIPPED
.endif
-PF_STATUS != ${SUDO} pfctl -si | sed -n 's/^Status: \([^ ]*\) .*/\1/p'
+PF_STATUS != ${SUDO} /sbin/pfctl -si | sed -n 's/^Status: \([^ ]*\) .*/\1/p'
.if empty(PF_STATUS:MEnabled)
regress:
@echo pf status: "${PF_STATUS}"
@echo Enable pf to run this regress.
@echo SKIPPED
.endif
-PF_SKIP != ${SUDO} pfctl -sI -v | sed -n 's/ (skip)//p'
+PF_SKIP != ${SUDO} /sbin/pfctl -sI -v | sed -n 's/ (skip)//p'
.if ! empty(PF_SKIP:Mlo*:Nlo0)
regress:
@echo pf skip: "${PF_SKIP}"
@echo SKIPPED
.endif
-PF_ANCHOR != ${SUDO} pfctl -sr | sed -n 's/^anchor "\([^"]*\)" all$$/\1/p'
+PF_ANCHOR != ${SUDO} /sbin/pfctl -sr |\
+ sed -n 's/^anchor "\([^"]*\)" all$$/\1/p'
.if empty(PF_ANCHOR:Mregress)
regress:
@echo pf anchor: "${PF_ANCHOR}"
ifconfig: unconfig
# Create and configure loopback interfaces.
.for n in ${NUMS}
- ${SUDO} ifconfig lo$n rdomain $n
- ${SUDO} ifconfig lo$n inet 127.0.0.1/8
- ${SUDO} ifconfig lo$n inet6 ::1/128
- ${SUDO} ifconfig lo$n inet ${SRC_TUNNEL4_$n} alias
- ${SUDO} ifconfig lo$n inet6 ${SRC_TUNNEL6_$n} alias
- ${SUDO} route -n -T $n add -inet -host ${DST_TUNNEL4_$n} 127.0.0.1
- ${SUDO} route -n -T $n add -inet6 -host ${DST_TUNNEL6_$n} ::1
- ${SUDO} ifconfig gif$n4 create rdomain $n tunneldomain $n
- ${SUDO} ifconfig gif$n4 tunnel ${SRC_TUNNEL4_$n} ${DST_TUNNEL4_$n}
- ${SUDO} ifconfig gif$n4 inet ${TUNNEL4_SRC_ADDR4_$n}/32\
+ ${SUDO} /sbin/ifconfig lo$n rdomain $n
+ ${SUDO} /sbin/ifconfig lo$n inet 127.0.0.1/8
+ ${SUDO} /sbin/ifconfig lo$n inet6 ::1/128
+ ${SUDO} /sbin/ifconfig lo$n inet ${SRC_TUNNEL4_$n} alias
+ ${SUDO} /sbin/ifconfig lo$n inet6 ${SRC_TUNNEL6_$n} alias
+ ${SUDO} /sbin/route -n -T $n add -inet -host ${DST_TUNNEL4_$n} 127.0.0.1
+ ${SUDO} /sbin/route -n -T $n add -inet6 -host ${DST_TUNNEL6_$n} ::1
+ ${SUDO} /sbin/ifconfig gif$n4 create rdomain $n tunneldomain $n
+ ${SUDO} /sbin/ifconfig gif$n4 tunnel ${SRC_TUNNEL4_$n} ${DST_TUNNEL4_$n}
+ ${SUDO} /sbin/ifconfig gif$n4 inet ${TUNNEL4_SRC_ADDR4_$n}/32\
${TUNNEL4_DST_ADDR4_$n}
- ${SUDO} ifconfig gif$n4 inet6 ${TUNNEL4_SRC_ADDR6_$n}\
+ ${SUDO} /sbin/ifconfig gif$n4 inet6 ${TUNNEL4_SRC_ADDR6_$n}\
${TUNNEL4_DST_ADDR6_$n}
- ${SUDO} ifconfig gif$n6 create rdomain $n tunneldomain $n
- ${SUDO} ifconfig gif$n6 tunnel ${SRC_TUNNEL6_$n}\
+ ${SUDO} /sbin/ifconfig gif$n6 create rdomain $n tunneldomain $n
+ ${SUDO} /sbin/ifconfig gif$n6 tunnel ${SRC_TUNNEL6_$n}\
${DST_TUNNEL6_$n}
- ${SUDO} ifconfig gif$n6 inet ${TUNNEL6_SRC_ADDR4_$n}/32\
+ ${SUDO} /sbin/ifconfig gif$n6 inet ${TUNNEL6_SRC_ADDR4_$n}/32\
${TUNNEL6_DST_ADDR4_$n}
- ${SUDO} ifconfig gif$n6 inet6 ${TUNNEL6_SRC_ADDR6_$n}\
+ ${SUDO} /sbin/ifconfig gif$n6 inet6 ${TUNNEL6_SRC_ADDR6_$n}\
${TUNNEL6_DST_ADDR6_$n}
.endfor
- # Wait until DAD for inet6 tunnel addresses has finished.
- sleep 1
+ # Wait until IPv6 addresses are no longer tentative.
+ for i in `jot 50`; do\
+ if ! { /sbin/ifconfig lo${N1}; /sbin/ifconfig lo${N2};\
+ /sbin/ifconfig gif${N1}4; /sbin/ifconfig gif${N1}6;\
+ /sbin/ifconfig gif${N2}4; /sbin/ifconfig gif${N2}6; }\
+ | fgrep -q tentative; then\
+ break;\
+ fi;\
+ sleep .1;\
+ done
+ ! { /sbin/ifconfig lo${N1}; /sbin/ifconfig lo${N2};\
+ /sbin/ifconfig gif${N1}4; /sbin/ifconfig gif${N1}6;\
+ /sbin/ifconfig gif${N2}4; /sbin/ifconfig gif${N2}6; }\
+ | fgrep -q tentative
REGRESS_CLEANUP += unconfig
unconfig:
# Destroy interfaces, keep lo as routing domain cannot be destroyed.
.for n in ${NUMS}
- -${SUDO} ifconfig lo$n rdomain $n
- -${SUDO} ifconfig lo$n inet 127.0.0.1 delete
- -${SUDO} ifconfig lo$n inet6 ::1 delete
- -${SUDO} ifconfig lo$n inet ${SRC_TUNNEL4_$n} delete
- -${SUDO} ifconfig lo$n inet6 ${SRC_TUNNEL6_$n} delete
- -${SUDO} ifconfig gif$n4 destroy
- -${SUDO} ifconfig gif$n6 destroy
+ -${SUDO} /sbin/ifconfig lo$n rdomain $n
+ -${SUDO} /sbin/ifconfig lo$n inet 127.0.0.1 delete
+ -${SUDO} /sbin/ifconfig lo$n inet6 ::1 delete
+ -${SUDO} /sbin/ifconfig lo$n inet ${SRC_TUNNEL4_$n} delete
+ -${SUDO} /sbin/ifconfig lo$n inet6 ${SRC_TUNNEL6_$n} delete
+ -${SUDO} /sbin/ifconfig gif$n4 destroy
+ -${SUDO} /sbin/ifconfig gif$n6 destroy
.endfor
rm -f stamp-ifconfig
pfctl: addr.py pf.conf
# Load the pf rules into the kernel.
cat addr.py ${.CURDIR}/pf.conf | /sbin/pfctl -n -f -
- cat addr.py ${.CURDIR}/pf.conf | ${SUDO} pfctl -a regress -f -
+ cat addr.py ${.CURDIR}/pf.conf | ${SUDO} /sbin/pfctl -a regress -f -
# ifconfig gif inet6 DAD created tunnel states based on old pf rules
${SUDO} /sbin/pfctl -Fs
-# $OpenBSD: Makefile,v 1.8 2021/07/06 11:26:47 bluhm Exp $
+# $OpenBSD: Makefile,v 1.9 2022/04/29 17:27:37 bluhm Exp $
# Copyright (c) 2017-2020 Alexander Bluhm <bluhm@openbsd.org>
#
@echo SKIPPED
.endif
-PF_STATUS != ${SUDO} pfctl -si | sed -n 's/^Status: \([^ ]*\) .*/\1/p'
+PF_STATUS != ${SUDO} /sbin/pfctl -si | sed -n 's/^Status: \([^ ]*\) .*/\1/p'
.if empty(PF_STATUS:MEnabled)
regress:
@echo pf status: "${PF_STATUS}"
@echo SKIPPED
.endif
-PF_SKIP != ${SUDO} pfctl -sI -v | sed -n 's/ (skip)//p'
+PF_SKIP != ${SUDO} /sbin/pfctl -sI -v | sed -n 's/ (skip)//p'
.if ! empty(PF_SKIP:Mlo*:Nlo0)
regress:
@echo pf skip: "${PF_SKIP}"
@echo SKIPPED
.endif
-PF_ANCHOR != ${SUDO} pfctl -sr | sed -n 's/^anchor "\([^"]*\)" all$$/\1/p'
+PF_ANCHOR != ${SUDO} /sbin/pfctl -sr |\
+ sed -n 's/^anchor "\([^"]*\)" all$$/\1/p'
.if empty(PF_ANCHOR:Mregress)
regress:
@echo pf anchor: "${PF_ANCHOR}"
ifconfig: unconfig
# Create and configure loopback interfaces.
.for n in ${NUMS}
- ${SUDO} ifconfig lo$n rdomain $n
- ${SUDO} ifconfig lo$n inet 127.0.0.1/8
- ${SUDO} ifconfig lo$n inet 127.0.0.$n alias
- ${SUDO} route -n -T $n add -inet -host 10.6.6.6 127.0.0.1
- ${SUDO} route -n -T $n add -inet -host 10.7.7.7 127.0.0.1
+ ${SUDO} /sbin/ifconfig lo$n rdomain $n
+ ${SUDO} /sbin/ifconfig lo$n inet 127.0.0.1/8
+ ${SUDO} /sbin/ifconfig lo$n inet 127.0.0.$n alias
+ ${SUDO} /sbin/route -n -T $n add -inet -host 10.6.6.6 127.0.0.1
+ ${SUDO} /sbin/route -n -T $n add -inet -host 10.7.7.7 127.0.0.1
.endfor
- ${SUDO} route -n -T ${N1} add -inet -host 127.0.0.${N2} 127.0.0.1
- ${SUDO} route -n -T ${N2} add -inet -host 127.0.0.${N1} 127.0.0.1
+ ${SUDO} /sbin/route -n -T ${N1} add -inet -host 127.0.0.${N2} 127.0.0.1
+ ${SUDO} /sbin/route -n -T ${N2} add -inet -host 127.0.0.${N1} 127.0.0.1
+ # Wait until IPv6 addresses are no longer tentative.
+ for i in `jot 50`; do\
+ if ! { /sbin/ifconfig lo${N1}; /sbin/ifconfig lo${N2}; }\
+ | fgrep -q tentative; then\
+ break;\
+ fi;\
+ sleep .1;\
+ done
+ ! { /sbin/ifconfig lo${N1}; /sbin/ifconfig lo${N2}; }\
+ | fgrep tentative
REGRESS_CLEANUP += unconfig
unconfig: stamp-stop
# Destroy interfaces.
.for n in ${NUMS}
- -${SUDO} ifconfig lo$n 127.0.0.1 delete
- -${SUDO} ifconfig lo$n 127.0.0.$n delete
+ -${SUDO} /sbin/ifconfig lo$n rdomain $n
+ -${SUDO} /sbin/ifconfig lo$n inet 127.0.0.1 delete
+ -${SUDO} /sbin/ifconfig lo$n inet 127.0.0.$n delete
.endfor
rm -f stamp-ifconfig
pfctl: addr.py pf.conf
# Load the pf rules into the kernel.
cat addr.py ${.CURDIR}/pf.conf | /sbin/pfctl -n -f -
- cat addr.py ${.CURDIR}/pf.conf | ${SUDO} pfctl -a regress -f -
+ cat addr.py ${.CURDIR}/pf.conf | ${SUDO} /sbin/pfctl -a regress -f -
# run tcpdump on lo devices
DUMPCMD = /usr/sbin/tcpdump -l -e -vvv -s 2048 -ni
-# $OpenBSD: Makefile,v 1.2 2021/04/21 10:18:35 bluhm Exp $
+# $OpenBSD: Makefile,v 1.3 2022/04/29 17:27:37 bluhm Exp $
# Copyright (c) 2021 Alexander Bluhm <bluhm@openbsd.org>
#
@echo SKIPPED
.endif
-PF_STATUS != ${SUDO} pfctl -si | sed -n 's/^Status: \([^ ]*\) .*/\1/p'
+PF_STATUS != ${SUDO} /sbin/pfctl -si | sed -n 's/^Status: \([^ ]*\) .*/\1/p'
.if empty(PF_STATUS:MEnabled)
regress:
@echo pf status: "${PF_STATUS}"
@echo SKIPPED
.endif
-PF_SKIP != ${SUDO} pfctl -sI -v | sed -n 's/ (skip)//p'
+PF_SKIP != ${SUDO} /sbin/pfctl -sI -v | sed -n 's/ (skip)//p'
.if ! empty(PF_SKIP:Mlo*:Nlo0)
regress:
@echo pf skip: "${PF_SKIP}"
@echo SKIPPED
.endif
-PF_ANCHOR != ${SUDO} pfctl -sr | sed -n 's/^anchor "\([^"]*\)" all$$/\1/p'
+PF_ANCHOR != ${SUDO} /sbin/pfctl -sr |\
+ sed -n 's/^anchor "\([^"]*\)" all$$/\1/p'
.if empty(PF_ANCHOR:Mregress)
regress:
@echo pf anchor: "${PF_ANCHOR}"
ifconfig: unconfig
# Create and configure pflog and loopback interfaces.
.for n in ${NUMS}
- ${SUDO} ifconfig lo$n rdomain $n
- ${SUDO} ifconfig lo$n inet 127.0.0.1/8
- ${SUDO} ifconfig lo$n inet6 ::1/128
- ${SUDO} route -n -T $n add -inet 169.254.0.0/16 127.0.0.1
- ${SUDO} route -n -T $n add -inet6 fc00::/48 ::1
+ ${SUDO} /sbin/ifconfig lo$n rdomain $n
+ ${SUDO} /sbin/ifconfig lo$n inet 127.0.0.1/8
+ ${SUDO} /sbin/ifconfig lo$n inet6 ::1/128
+ ${SUDO} /sbin/route -n -T $n add -inet 169.254.0.0/16 127.0.0.1
+ ${SUDO} /sbin/route -n -T $n add -inet6 fc00::/48 ::1
.endfor
.for n in ${PAIRS}
- ${SUDO} ifconfig pair$n rdomain $n
- ${SUDO} ifconfig pair$n inet ${IP_$n}/24
- ${SUDO} ifconfig pair$n inet6 ${IP6_$n}/64
+ ${SUDO} /sbin/ifconfig pair$n rdomain $n
+ ${SUDO} /sbin/ifconfig pair$n inet ${IP_$n}/24
+ ${SUDO} /sbin/ifconfig pair$n inet6 ${IP6_$n}/64
.endfor
- ${SUDO} ifconfig pair${N1} patch pair${N2}
- ${SUDO} ifconfig lo${N3} inet ${IP_${N3}}/24 alias
- ${SUDO} ifconfig lo${N3} inet6 ${IP6_${N3}}/64
- ${SUDO} ifconfig pair${N1} mtu 8000
- ${SUDO} route -n -T ${N1} add -inet ${IP_${N3}} ${IP_${N2}}
- ${SUDO} route -n -T ${N1} add -inet6 ${IP6_${N3}} ${IP6_${N2}}
+ ${SUDO} /sbin/ifconfig pair${N1} patch pair${N2}
+ ${SUDO} /sbin/ifconfig lo${N3} inet ${IP_${N3}}/24 alias
+ ${SUDO} /sbin/ifconfig lo${N3} inet6 ${IP6_${N3}}/64
+ ${SUDO} /sbin/ifconfig pair${N1} mtu 8000
+ ${SUDO} /sbin/route -n -T ${N1} add -inet ${IP_${N3}} ${IP_${N2}}
+ ${SUDO} /sbin/route -n -T ${N1} add -inet6 ${IP6_${N3}} ${IP6_${N2}}
# Wait until IPv6 addresses are no longer tentative.
for i in `jot 50`; do\
- if ! { ifconfig pair${N1}; ifconfig pair${N2}; ifconfig lo${N3}; }\
- | fgrep -q tentative; then\
+ if ! { /sbin/ifconfig pair${N1}; /sbin/ifconfig pair${N2};\
+ /sbin/ifconfig lo${N3}; } | fgrep -q tentative; then\
break;\
fi;\
sleep .1;\
done
- ! { ifconfig pair${N1}; ifconfig pair${N2}; ifconfig lo${N3};}\
- | fgrep tentative
+ ! { /sbin/ifconfig pair${N1}; /sbin/ifconfig pair${N2};\
+ /sbin/ifconfig lo${N3}; } | fgrep tentative
REGRESS_CLEANUP += unconfig
unconfig:
# Destroy interfaces.
- -${SUDO} route -n -T ${N1} delete -inet ${IP_${N3}}
- -${SUDO} route -n -T ${N1} delete -inet6 ${IP6_${N3}}
- -${SUDO} ifconfig lo${N3} inet ${IP_${N3}} delete
- -${SUDO} ifconfig lo${N3} inet6 ${IP6_${N3}} delete
+ -${SUDO} /sbin/route -n -T ${N1} delete -inet ${IP_${N3}}
+ -${SUDO} /sbin/route -n -T ${N1} delete -inet6 ${IP6_${N3}}
+ -${SUDO} /sbin/ifconfig lo${N3} rdomain ${N3}
+ -${SUDO} /sbin/ifconfig lo${N3} inet ${IP_${N3}} delete
+ -${SUDO} /sbin/ifconfig lo${N3} inet6 ${IP6_${N3}} delete
.for n in ${PAIRS}
- -${SUDO} ifconfig pair$n destroy
+ -${SUDO} /sbin/ifconfig pair$n destroy
.endfor
.for n in ${NUMS}
- -${SUDO} route -n -T $n delete -inet 169.254.0.0/16
- -${SUDO} route -n -T $n delete -inet6 fc00::/48
- -${SUDO} ifconfig lo$n inet 127.0.0.1 delete
- -${SUDO} ifconfig lo$n inet6 ::1 delete
+ -${SUDO} /sbin/route -n -T $n delete -inet 169.254.0.0/16
+ -${SUDO} /sbin/route -n -T $n delete -inet6 fc00::/48
+ -${SUDO} /sbin/ifconfig lo$n inet 127.0.0.1 delete
+ -${SUDO} /sbin/ifconfig lo$n inet6 ::1 delete
.endfor
rm -f stamp-ifconfig
pfctl: addr.py pf.conf
# Load the pf rules into the kernel.
cat addr.py ${.CURDIR}/pf.conf | /sbin/pfctl -n -f -
- cat addr.py ${.CURDIR}/pf.conf | ${SUDO} pfctl -a regress -f -
+ cat addr.py ${.CURDIR}/pf.conf | ${SUDO} /sbin/pfctl -a regress -f -
.for f in 1 2 3
.for t in 1 2 3
REGRESS_TARGETS += run-ping-$f-$t
run-ping-$f-$t:
- ping -c 1 -w 1 -n -V ${N$f} -I ${IP_${N$f}} ${IP_${N$t}}
+ /sbin/ping -c 1 -w 1 -n -V ${N$f} -I ${IP_${N$f}} ${IP_${N$t}}
REGRESS_TARGETS += run-ping6-$f-$t
run-ping6-$f-$t:
- ping6 -c 1 -w 1 -n -V ${N$f} -I ${IP6_${N$f}} ${IP6_${N$t}}
+ /sbin/ping6 -c 1 -w 1 -n -V ${N$f} -I ${IP6_${N$f}} ${IP6_${N$t}}
REGRESS_TARGETS += run-tcpbench-$f-$t
run-tcpbench-$f-$t:
tcpbench -4 -t 5 -V ${N$f} -b ${IP_${N$f}} ${IP_${N$t}}
.if $f == "3" && $t == "1"
# path MTU discovery must create a dynamic route
- route -T ${N$f} -n get -host -inet ${IP_${N$t}} | grep DYNAMIC
+ /sbin/route -T ${N$f} -n get -host -inet ${IP_${N$t}} | grep DYNAMIC
.endif
REGRESS_TARGETS += run-tcpbench6-$f-$t
tcpbench -6 -t 5 -V ${N$f} -b ${IP6_${N$f}} ${IP6_${N$t}}
.if $f == "3" && $t == "1"
# path MTU discovery in other rtable does not work in ip6_output()
- route -T ${N$f} -n get -host -inet6 ${IP6_${N$t}}
+ /sbin/route -T ${N$f} -n get -host -inet6 ${IP6_${N$t}}
@echo DISABLED
.endif
-# $OpenBSD: Makefile,v 1.3 2022/04/29 09:45:05 bluhm Exp $
+# $OpenBSD: Makefile,v 1.4 2022/04/29 17:27:37 bluhm Exp $
# Copyright (c) 2022 Alexander Bluhm <bluhm@openbsd.org>
#
.if ! (make(clean) || make(cleandir) || make(obj))
-PF_STATUS != ${SUDO} pfctl -si | sed -n 's/^Status: \([^ ]*\) .*/\1/p'
+PF_STATUS != ${SUDO} /sbin/pfctl -si | sed -n 's/^Status: \([^ ]*\) .*/\1/p'
.if empty(PF_STATUS:MEnabled)
regress:
@echo pf status: "${PF_STATUS}"
@echo SKIPPED
.endif
-PF_SKIP != ${SUDO} pfctl -sI -v | sed -n 's/ (skip)//p'
+PF_SKIP != ${SUDO} /sbin/pfctl -sI -v | sed -n 's/ (skip)//p'
.if ! empty(PF_SKIP:Mlo*:Nlo0)
regress:
@echo pf skip: "${PF_SKIP}"
@echo SKIPPED
.endif
-PF_ANCHOR != ${SUDO} pfctl -sr | sed -n 's/^anchor "\([^"]*\)" all$$/\1/p'
+PF_ANCHOR != ${SUDO} /sbin/pfctl -sr |\
+ sed -n 's/^anchor "\([^"]*\)" all$$/\1/p'
.if empty(PF_ANCHOR:Mregress)
regress:
@echo pf anchor: "${PF_ANCHOR}"
${SUDO} /sbin/ifconfig lo$n inet6 ::1/128
${SUDO} /sbin/ifconfig lo$n inet6 fe80::$n/64
.endfor
- ${SUDO} /sbin/route -n -T ${N1} add -inet -host 127.0.0.${N2} 127.0.0.1
- ${SUDO} /sbin/route -n -T ${N2} add -inet -host 127.0.0.${N1} 127.0.0.1
+ # Wait until IPv6 addresses are no longer tentative.
+ for i in `jot 50`; do\
+ if ! { /sbin/ifconfig lo${N1}; /sbin/ifconfig lo${N2}; }\
+ | fgrep -q tentative; then\
+ break;\
+ fi;\
+ sleep .1;\
+ done
+ ! { /sbin/ifconfig lo${N1}; /sbin/ifconfig lo${N2}; }\
+ | fgrep tentative
REGRESS_CLEANUP += unconfig
unconfig: stamp-stop
# Destroy interfaces.
.for n in ${NUMS}
+ -${SUDO} /sbin/ifconfig lo$n rdomain $n
-${SUDO} /sbin/ifconfig lo$n inet 127.0.0.1 delete
-${SUDO} /sbin/ifconfig lo$n inet 127.0.0.$n delete
-${SUDO} /sbin/ifconfig lo$n inet6 ::1 delete
pfctl: addr.py pf.conf
# Load the pf rules into the kernel.
cat addr.py ${.CURDIR}/pf.conf | /sbin/pfctl -n -f -
- cat addr.py ${.CURDIR}/pf.conf | ${SUDO} pfctl -a regress -f -
+ cat addr.py ${.CURDIR}/pf.conf | ${SUDO} /sbin/pfctl -a regress -f -
# run tcpdump on lo and pflog device
DUMPCMD = /usr/sbin/tcpdump -l -e -vvv -s 2048 -ni
# Only do that if necessary to keep visible output short.
.if ${.CURDIR} == ${.OBJDIR}
PYTHON = python3 -u ./
-PYPATH =
.else
-PYTHON = python3 -u ${.CURDIR}/
-PYPATH = PYTHONPATH=${.OBJDIR}
+PYTHON = env PYTHONPATH=${.OBJDIR} python3 -u ${.CURDIR}/
.endif
# ping
REGRESS_TARGETS += run-icmp
run-icmp: stamp-bpf
- ${SUDO} env ${PYPATH} /sbin/route -T ${N1} exec ${PYTHON}icmp.py N1
- ${SUDO} env ${PYPATH} /sbin/route -T ${N2} exec ${PYTHON}icmp.py N2
+ ${SUDO} /sbin/route -T ${N1} exec ${PYTHON}icmp.py N1
+ ${SUDO} /sbin/route -T ${N2} exec ${PYTHON}icmp.py N2
REGRESS_TARGETS += run-icmp6
run-icmp6: stamp-bpf
- ${SUDO} env ${PYPATH} /sbin/route -T ${N1} exec ${PYTHON}icmp6.py N1
- ${SUDO} env ${PYPATH} /sbin/route -T ${N2} exec ${PYTHON}icmp6.py N2
+ ${SUDO} /sbin/route -T ${N1} exec ${PYTHON}icmp6.py N1
+ ${SUDO} /sbin/route -T ${N2} exec ${PYTHON}icmp6.py N2
REGRESS_TARGETS += run-bpf-icmp
run-bpf-icmp: stamp-stop
REGRESS_TARGETS += run-icmp6-hop
run-icmp6-hop: stamp-bpf
- ${SUDO} env ${PYPATH} /sbin/route -T ${N1} exec ${PYTHON}icmp6_hop.py N1
- ${SUDO} env ${PYPATH} /sbin/route -T ${N2} exec ${PYTHON}icmp6_hop.py N2
+ ${SUDO} /sbin/route -T ${N1} exec ${PYTHON}icmp6_hop.py N1
+ ${SUDO} /sbin/route -T ${N2} exec ${PYTHON}icmp6_hop.py N2
REGRESS_TARGETS += run-icmp6-dst
run-icmp6-dst: stamp-bpf
- ${SUDO} env ${PYPATH} /sbin/route -T ${N1} exec ${PYTHON}icmp6_dst.py N1
- ${SUDO} env ${PYPATH} /sbin/route -T ${N2} exec ${PYTHON}icmp6_dst.py N2
+ ${SUDO} /sbin/route -T ${N1} exec ${PYTHON}icmp6_dst.py N1
+ ${SUDO} /sbin/route -T ${N2} exec ${PYTHON}icmp6_dst.py N2
REGRESS_TARGETS += run-bpf-ext
run-bpf-ext: stamp-stop
REGRESS_TARGETS += run-icmp-pad
run-icmp-pad: stamp-bpf
- ${SUDO} env ${PYPATH} /sbin/route -T ${N1} exec ${PYTHON}icmp_pad.py N1
- ${SUDO} env ${PYPATH} /sbin/route -T ${N2} exec ${PYTHON}icmp_pad.py N2
+ ${SUDO} /sbin/route -T ${N1} exec ${PYTHON}icmp_pad.py N1
+ ${SUDO} /sbin/route -T ${N2} exec ${PYTHON}icmp_pad.py N2
REGRESS_TARGETS += run-icmp-eol
run-icmp-eol: stamp-bpf
- ${SUDO} env ${PYPATH} /sbin/route -T ${N1} exec ${PYTHON}icmp_eol.py N1
- ${SUDO} env ${PYPATH} /sbin/route -T ${N2} exec ${PYTHON}icmp_eol.py N2
+ ${SUDO} /sbin/route -T ${N1} exec ${PYTHON}icmp_eol.py N1
+ ${SUDO} /sbin/route -T ${N2} exec ${PYTHON}icmp_eol.py N2
REGRESS_TARGETS += run-icmp6-pad
run-icmp6-pad: stamp-bpf
- ${SUDO} env ${PYPATH} /sbin/route -T ${N1} exec ${PYTHON}icmp6_hop_pad.py N1
- ${SUDO} env ${PYPATH} /sbin/route -T ${N2} exec ${PYTHON}icmp6_hop_pad.py N2
+ ${SUDO} /sbin/route -T ${N1} exec ${PYTHON}icmp6_hop_pad.py N1
+ ${SUDO} /sbin/route -T ${N2} exec ${PYTHON}icmp6_hop_pad.py N2
REGRESS_TARGETS += run-icmp-ra
run-icmp-ra: stamp-bpf
- ${SUDO} env ${PYPATH} /sbin/route -T ${N1} exec ${PYTHON}icmp_ra.py N1
- ${SUDO} env ${PYPATH} /sbin/route -T ${N2} exec ${PYTHON}icmp_ra.py N2
+ ${SUDO} /sbin/route -T ${N1} exec ${PYTHON}icmp_ra.py N1
+ ${SUDO} /sbin/route -T ${N2} exec ${PYTHON}icmp_ra.py N2
REGRESS_TARGETS += run-icmp6-ra
run-icmp6-ra: stamp-bpf
- ${SUDO} env ${PYPATH} /sbin/route -T ${N1} exec ${PYTHON}icmp6_hop_ra.py N1
- ${SUDO} env ${PYPATH} /sbin/route -T ${N2} exec ${PYTHON}icmp6_hop_ra.py N2
+ ${SUDO} /sbin/route -T ${N1} exec ${PYTHON}icmp6_hop_ra.py N1
+ ${SUDO} /sbin/route -T ${N2} exec ${PYTHON}icmp6_hop_ra.py N2
REGRESS_TARGETS += run-icmp-bad
run-icmp-bad: stamp-bpf
- ${SUDO} env ${PYPATH} /sbin/route -T ${N1} exec ${PYTHON}icmp_bad.py N1
- ${SUDO} env ${PYPATH} /sbin/route -T ${N2} exec ${PYTHON}icmp_bad.py N2
+ ${SUDO} /sbin/route -T ${N1} exec ${PYTHON}icmp_bad.py N1
+ ${SUDO} /sbin/route -T ${N2} exec ${PYTHON}icmp_bad.py N2
REGRESS_TARGETS += run-icmp6-bad
run-icmp6-bad: stamp-bpf
- ${SUDO} env ${PYPATH} /sbin/route -T ${N1} exec ${PYTHON}icmp6_hop_bad.py N1
- ${SUDO} env ${PYPATH} /sbin/route -T ${N2} exec ${PYTHON}icmp6_hop_bad.py N2
+ ${SUDO} /sbin/route -T ${N1} exec ${PYTHON}icmp6_hop_bad.py N1
+ ${SUDO} /sbin/route -T ${N2} exec ${PYTHON}icmp6_hop_bad.py N2
REGRESS_TARGETS += run-bpf-opts
run-bpf-opts: stamp-stop
REGRESS_TARGETS += run-igmp
run-igmp: stamp-bpf
- ${SUDO} env ${PYPATH} /sbin/route -T ${N1} exec ${PYTHON}igmp_ra.py N1
- ${SUDO} env ${PYPATH} /sbin/route -T ${N2} exec ${PYTHON}igmp_ra.py N2
+ ${SUDO} /sbin/route -T ${N1} exec ${PYTHON}igmp_ra.py N1
+ ${SUDO} /sbin/route -T ${N2} exec ${PYTHON}igmp_ra.py N2
REGRESS_TARGETS += run-icmp6-mld
run-icmp6-mld: stamp-bpf
- ${SUDO} env ${PYPATH} /sbin/route -T ${N1} exec ${PYTHON}icmp6_mld_ra.py N1
- ${SUDO} env ${PYPATH} /sbin/route -T ${N2} exec ${PYTHON}icmp6_mld_ra.py N2
+ ${SUDO} /sbin/route -T ${N1} exec ${PYTHON}icmp6_mld_ra.py N1
+ ${SUDO} /sbin/route -T ${N2} exec ${PYTHON}icmp6_mld_ra.py N2
REGRESS_TARGETS += run-bpf-mcast
run-bpf-mcast: stamp-stop
REGRESS_TARGETS += run-igmp-bad
run-igmp-bad: stamp-bpf
- ${SUDO} env ${PYPATH} /sbin/route -T ${N1} exec ${PYTHON}igmp_bad.py N1
- ${SUDO} env ${PYPATH} /sbin/route -T ${N2} exec ${PYTHON}igmp_bad.py N2
+ ${SUDO} /sbin/route -T ${N1} exec ${PYTHON}igmp_bad.py N1
+ ${SUDO} /sbin/route -T ${N2} exec ${PYTHON}igmp_bad.py N2
REGRESS_TARGETS += run-icmp6-mld-bad
run-icmp6-mld-bad: stamp-bpf
- ${SUDO} env ${PYPATH} /sbin/route -T ${N1} exec ${PYTHON}icmp6_mld_bad.py N1
- ${SUDO} env ${PYPATH} /sbin/route -T ${N2} exec ${PYTHON}icmp6_mld_bad.py N2
+ ${SUDO} /sbin/route -T ${N1} exec ${PYTHON}icmp6_mld_bad.py N1
+ ${SUDO} /sbin/route -T ${N2} exec ${PYTHON}icmp6_mld_bad.py N2
REGRESS_TARGETS += run-bpf-mcast-bad
run-bpf-mcast-bad: stamp-stop
-# $OpenBSD: Makefile,v 1.7 2021/01/20 13:50:09 bluhm Exp $
+# $OpenBSD: Makefile,v 1.8 2022/04/29 17:27:37 bluhm Exp $
# Copyright (c) 2021 Alexander Bluhm <bluhm@openbsd.org>
#
.if ! (make(clean) || make(cleandir) || make(obj))
-PF_STATUS != ${SUDO} pfctl -si | sed -n 's/^Status: \([^ ]*\) .*/\1/p'
+PF_STATUS != ${SUDO} /sbin/pfctl -si | sed -n 's/^Status: \([^ ]*\) .*/\1/p'
.if empty(PF_STATUS:MEnabled)
regress:
@echo pf status: "${PF_STATUS}"
@echo SKIPPED
.endif
-PF_SKIP != ${SUDO} pfctl -sI -v | sed -n 's/ (skip)//p'
+PF_SKIP != ${SUDO} /sbin/pfctl -sI -v | sed -n 's/ (skip)//p'
.if ! empty(PF_SKIP:Mlo*:Nlo0)
regress:
@echo pf skip: "${PF_SKIP}"
@echo SKIPPED
.endif
-PF_ANCHOR != ${SUDO} pfctl -sr | sed -n 's/^anchor "\([^"]*\)" all$$/\1/p'
+PF_ANCHOR != ${SUDO} /sbin/pfctl -sr |\
+ sed -n 's/^anchor "\([^"]*\)" all$$/\1/p'
.if empty(PF_ANCHOR:Mregress)
regress:
@echo pf anchor: "${PF_ANCHOR}"
ifconfig: unconfig
# Create and configure pflog and loopback interfaces.
.for n in ${NUMS}
- ${SUDO} ifconfig pflog$n create
+ ${SUDO} /sbin/ifconfig pflog$n create
.endfor
- ${SUDO} ifconfig lo$N rdomain $N
- ${SUDO} ifconfig lo$N inet 127.0.0.1/8
- ${SUDO} ifconfig lo$N inet6 ::1/128
+ ${SUDO} /sbin/ifconfig lo$N rdomain $N
+ ${SUDO} /sbin/ifconfig lo$N inet 127.0.0.1/8
+ ${SUDO} /sbin/ifconfig lo$N inet6 ::1/128
.for i in ${IPS} 21 22 23 24
- ${SUDO} ifconfig lo$N inet 169.254.0.$i/32 alias
- ${SUDO} ifconfig lo$N inet6 fc00::$i/128
+ ${SUDO} /sbin/ifconfig lo$N inet 169.254.0.$i/32 alias
+ ${SUDO} /sbin/ifconfig lo$N inet6 fc00::$i/128
.endfor
+ # Wait until IPv6 addresses are no longer tentative.
+ for i in `jot 50`; do\
+ if ! { /sbin/ifconfig pair${N1}; /sbin/ifconfig pair${N2};\
+ /sbin/ifconfig lo${N3}; } | fgrep -q tentative; then\
+ break;\
+ fi;\
+ sleep .1;\
+ done
+ ! { /sbin/ifconfig pair${N1}; /sbin/ifconfig pair${N2};\
+ /sbin/ifconfig lo${N3}; } | fgrep tentative
+
REGRESS_CLEANUP += unconfig
unconfig: stamp-stop
# Destroy interfaces.
+ -${SUDO} /sbin/ifconfig lo$N rdomain $N
.for i in ${IPS} 21 22 23 24
- -${SUDO} ifconfig lo$N inet 169.254.0.$i delete
- -${SUDO} ifconfig lo$N inet6 fc00::$i delete
+ -${SUDO} /sbin/ifconfig lo$N inet 169.254.0.$i delete
+ -${SUDO} /sbin/ifconfig lo$N inet6 fc00::$i delete
.endfor
- -${SUDO} ifconfig lo$N inet 127.0.0.1 delete
- -${SUDO} ifconfig lo$N inet6 ::1 delete
+ -${SUDO} /sbin/ifconfig lo$N inet 127.0.0.1 delete
+ -${SUDO} /sbin/ifconfig lo$N inet6 ::1 delete
.for n in ${NUMS}
- -${SUDO} ifconfig pflog$n destroy
+ -${SUDO} /sbin/ifconfig pflog$n destroy
.endfor
rm -f stamp-ifconfig
pfctl: addr.py pf.conf
# Load the pf rules into the kernel.
cat addr.py ${.CURDIR}/pf.conf | /sbin/pfctl -n -f -
- cat addr.py ${.CURDIR}/pf.conf | ${SUDO} pfctl -a regress -f -
+ cat addr.py ${.CURDIR}/pf.conf | ${SUDO} /sbin/pfctl -a regress -f -
# Run tcpdump on pflog devices.
DUMPCMD = /usr/sbin/tcpdump -l -e -vvv -s 2048 -ni
.for i in ${IPS}
REGRESS_TARGETS += run-ping-$i
run-ping-$i: stamp-bpf
- ping -n -w 1 -c 1 -V $N 169.254.0.$i
+ /sbin/ping -n -w 1 -c 1 -V $N 169.254.0.$i
REGRESS_TARGETS += run-ping6-$i
run-ping6-$i: stamp-bpf
- ping6 -n -w 1 -c 1 -V $N fc00::$i
+ /sbin/ping6 -n -w 1 -c 1 -V $N fc00::$i
REGRESS_TARGETS += run-udp-$i
run-udp-$i: stamp-bpf
REGRESS_TARGETS += run-ping6-0
run-ping6-0: stamp-bpf
- ping6 -n -w 1 -c 1 -V $N ::1
+ /sbin/ping6 -n -w 1 -c 1 -V $N ::1
REGRESS_TARGETS += run-udp6-0
run-udp6-0: stamp-bpf
-# $OpenBSD: Makefile,v 1.9 2021/10/02 07:07:08 anton Exp $
+# $OpenBSD: Makefile,v 1.10 2022/04/29 17:27:38 bluhm Exp $
#
# template_v10
# ----------------
.if ! (make(clean) || make(cleandir) || make(obj))
-PF_STATUS != ${SUDO} pfctl -si | sed -n 's/^Status: \([^ ]*\) .*/\1/p'
+PF_STATUS != ${SUDO} /sbin/pfctl -si | sed -n 's/^Status: \([^ ]*\) .*/\1/p'
.if empty(PF_STATUS:MEnabled)
regress:
@echo pf status: "${PF_STATUS}"
-# $OpenBSD: Makefile,v 1.4 2021/10/02 07:07:47 anton Exp $
+# $OpenBSD: Makefile,v 1.5 2022/04/29 17:27:38 bluhm Exp $
REGRESS_TARGETS= vxlan_1 vxlan_2.inet vxlan_2.dyn
REGRESS_ROOT_TARGETS= vxlan_1 vxlan_2.inet vxlan_2.dyn
${SUDO} ksh ${.CURDIR}/${@:R}.sh -R "40 41 42 43 44" -f inet
vxlan_2.dyn:
- env SUDO="${SUDO}" DYNAMIC=1 ksh ${.CURDIR}/${@:R}.sh -R "40 41 42 43 44" -f inet
+ env SUDO="${SUDO}" DYNAMIC=1 \
+ ksh ${.CURDIR}/${@:R}.sh -R "40 41 42 43 44" -f inet
vxlan_2.inet6:
${SUDO} ksh ${.CURDIR}/${@:R}.sh -R "40 41 42 43 44" -f inet6
vxlan_2.dyn6:
- env SUDO="${SUDO}" DYNAMIC=1 ksh ${.CURDIR}/${@:R}.sh -R "40 41 42 43 44" -f inet6
+ env SUDO="${SUDO}" DYNAMIC=1 \
+ ksh ${.CURDIR}/${@:R}.sh -R "40 41 42 43 44" -f inet6
.include <bsd.regress.mk>