robsd-exec: timeout 3600s + . /usr/local/libexec/robsd/util-regress.sh + config_load + << "EOF" + _err=0 + _env=REGRESS_FAIL_EARLY=no + config_value regress-sys/net/loop-env + 2> /dev/null + _env=REGRESS_FAIL_EARLY=no GOCACHE=/tmp N1=17 N2=18 + _make=make -C /home/src/regress/sys/net/loop REGRESS_FAIL_EARLY=no GOCACHE=/tmp N1=17 N2=18 + config_value regress-sys/net/loop-targets + regress_root sys/net/loop + export SUDO + unpriv -c staff build exec make -C /home/src/regress/sys/net/loop REGRESS_FAIL_EARLY=no GOCACHE=/tmp N1=17 N2=18 regress ==== busy-rdomains ==== # Check if rdomains are busy. ==== ifconfig ==== sleep 2 # XXX doas -n pkill -f '^/usr/sbin/tcpdump -l -e -vvv -s 2048 -ni' *** Error 1 in target 'stamp-stop' (ignored) rm -f stamp-bpf* # Destroy interfaces. doas -n /sbin/ifconfig lo17 rdomain 17 doas -n /sbin/ifconfig lo17 inet 127.0.0.1 delete ifconfig: SIOCDIFADDR: Can't assign requested address *** Error 1 in target 'unconfig' (ignored) doas -n /sbin/ifconfig lo17 inet 127.0.0.17 delete ifconfig: SIOCDIFADDR: Can't assign requested address *** Error 1 in target 'unconfig' (ignored) doas -n /sbin/ifconfig lo17 destroy doas -n /sbin/ifconfig lo18 rdomain 18 doas -n /sbin/ifconfig lo18 inet 127.0.0.1 delete ifconfig: SIOCDIFADDR: Can't assign requested address *** Error 1 in target 'unconfig' (ignored) doas -n /sbin/ifconfig lo18 inet 127.0.0.18 delete ifconfig: SIOCDIFADDR: Can't assign requested address *** Error 1 in target 'unconfig' (ignored) doas -n /sbin/ifconfig lo18 destroy rm -f stamp-ifconfig # Create and configure loopback interfaces. doas -n /sbin/ifconfig lo17 rdomain 17 doas -n /sbin/ifconfig lo17 inet 127.0.0.1/8 doas -n /sbin/ifconfig lo17 inet 127.0.0.17 alias doas -n /sbin/route -n -T 17 add -inet -host 10.6.6.6 127.0.0.1 add host 10.6.6.6: gateway 127.0.0.1 doas -n /sbin/route -n -T 17 add -inet -host 10.7.7.7 127.0.0.1 add host 10.7.7.7: gateway 127.0.0.1 doas -n /sbin/ifconfig lo18 rdomain 18 doas -n /sbin/ifconfig lo18 inet 127.0.0.1/8 doas -n /sbin/ifconfig lo18 inet 127.0.0.18 alias doas -n /sbin/route -n -T 18 add -inet -host 10.6.6.6 127.0.0.1 add host 10.6.6.6: gateway 127.0.0.1 doas -n /sbin/route -n -T 18 add -inet -host 10.7.7.7 127.0.0.1 add host 10.7.7.7: gateway 127.0.0.1 doas -n /sbin/route -n -T 17 add -inet -host 127.0.0.18 127.0.0.1 add host 127.0.0.18: gateway 127.0.0.1 doas -n /sbin/route -n -T 18 add -inet -host 127.0.0.17 127.0.0.1 add host 127.0.0.17: gateway 127.0.0.1 # Wait until IPv6 addresses are no longer tentative. for i in `jot 50`; do if ! { /sbin/ifconfig lo17; /sbin/ifconfig lo18; } | fgrep -q tentative; then break; fi; sleep .1; done ! { /sbin/ifconfig lo17; /sbin/ifconfig lo18; } | fgrep tentative ==== pfctl ==== # Create python include file containing the addresses. rm -f addr.py addr.py.tmp echo 'N1="17"' >>addr.py.tmp echo 'IF_N1="lo17"' >>addr.py.tmp echo 'ADDR_N1="127.0.0.17"' >>addr.py.tmp echo 'N2="18"' >>addr.py.tmp echo 'IF_N2="lo18"' >>addr.py.tmp echo 'ADDR_N2="127.0.0.18"' >>addr.py.tmp mv addr.py.tmp addr.py # Load the pf rules into the kernel. cat addr.py /home/src/regress/sys/net/loop/pf.conf | /sbin/pfctl -n -f - cat addr.py /home/src/regress/sys/net/loop/pf.conf | doas -n /sbin/pfctl -a regress -f - ==== run-ping-local-17 ==== rm -f lo17.tcpdump doas -n pkill -f '^/usr/sbin/tcpdump -l -e -vvv -s 2048 -ni lo17' || true doas -n /usr/sbin/tcpdump -l -e -vvv -s 2048 -ni lo17 >lo17.tcpdump & rm -f stamp-stop rm -f lo18.tcpdump doas -n pkill -f '^/usr/sbin/tcpdump -l -e -vvv -s 2048 -ni lo18' || true tcpdump: listening on lo17, link-type LOOP doas -n /usr/sbin/tcpdump -l -e -vvv -s 2048 -ni lo18 >lo18.tcpdump & rm -f stamp-stop sleep 2 # XXX tcpdump: listening on lo18, link-type LOOP # Ping localhost in routing domain 17. /sbin/ping -n -w 1 -c 1 -V 17 127.0.0.1 PING 127.0.0.1 (127.0.0.1): 56 data bytes 64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=0.085 ms --- 127.0.0.1 ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.085/0.085/0.085/0.000 ms ==== run-ping-loop-17 ==== # Ping non existing address with loopback route in routing domain 17. ! /sbin/ping -n -w 1 -c 1 -V 17 10.6.6.6 PING 10.6.6.6 (10.6.6.6): 56 data bytes --- 10.6.6.6 ping statistics --- 1 packets transmitted, 0 packets received, 100.0% packet loss ==== run-ping-address-17 ==== # Ping local address in routing domain 17. /sbin/ping -n -w 1 -c 1 -V 17 127.0.0.17 PING 127.0.0.17 (127.0.0.17): 56 data bytes 64 bytes from 127.0.0.17: icmp_seq=0 ttl=255 time=0.085 ms --- 127.0.0.17 ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.085/0.085/0.085/0.000 ms ==== run-ping-local-18 ==== # Ping localhost in routing domain 18. /sbin/ping -n -w 1 -c 1 -V 18 127.0.0.1 PING 127.0.0.1 (127.0.0.1): 56 data bytes 64 bytes from 127.0.0.1: icmp_seq=0 ttl=255 time=0.085 ms --- 127.0.0.1 ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.085/0.085/0.085/0.000 ms ==== run-ping-loop-18 ==== # Ping non existing address with loopback route in routing domain 18. ! /sbin/ping -n -w 1 -c 1 -V 18 10.6.6.6 PING 10.6.6.6 (10.6.6.6): 56 data bytes --- 10.6.6.6 ping statistics --- 1 packets transmitted, 0 packets received, 100.0% packet loss ==== run-ping-address-18 ==== # Ping local address in routing domain 18. /sbin/ping -n -w 1 -c 1 -V 18 127.0.0.18 PING 127.0.0.18 (127.0.0.18): 56 data bytes 64 bytes from 127.0.0.18: icmp_seq=0 ttl=255 time=0.090 ms --- 127.0.0.18 ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.090/0.090/0.090/0.000 ms ==== run-ping-rdomain-pass ==== # Pass ping packets between routing domains with pf rule. /sbin/ping -n -w 1 -c 1 -V 17 127.0.0.18 PING 127.0.0.18 (127.0.0.18): 56 data bytes 64 bytes from 127.0.0.18: icmp_seq=0 ttl=255 time=0.091 ms --- 127.0.0.18 ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/std-dev = 0.091/0.091/0.091/0.000 ms ==== run-ping-rdomain-block ==== # Check that reverse direction without pf rule is not allowed. ! /sbin/ping -n -w 1 -c 1 -V 18 127.0.0.17 PING 127.0.0.17 (127.0.0.17): 56 data bytes --- 127.0.0.17 ping statistics --- 1 packets transmitted, 0 packets received, 100.0% packet loss ==== run-ping-rdomain-loop ==== # Ping non existing address and loop between routing domains. ! /sbin/ping -n -w 1 -c 1 -V 17 10.7.7.7 PING 10.7.7.7 (10.7.7.7): 56 data bytes --- 10.7.7.7 ping statistics --- 1 packets transmitted, 0 packets received, 100.0% packet loss ==== run-bpf-local-17 ==== sleep 2 # XXX doas -n pkill -f '^/usr/sbin/tcpdump -l -e -vvv -s 2048 -ni' 488 packets received by filter 489 packets received by filter 0 packets dropped by kernel 0 packets dropped by kernel rm -f stamp-bpf* # Check that the ping packet went through loopback. grep '127.0.0.1 > 127.0.0.1: icmp: echo request' lo17.tcpdump 13:46:07.725158 127.0.0.1 > 127.0.0.1: icmp: echo request (id:f2c9 seq:0) [icmp cksum ok] (ttl 255, id 23747, len 84, bad ip cksum 0! -> 60e3) ==== run-bpf-loop-17 ==== # Check that the ping packet went multiple times through loopback. grep '[0-9] 127.0.0.1 > 10.6.6.6: icmp: echo request .*ttl 255,' lo17.tcpdump 13:46:07.810121 127.0.0.1 > 10.6.6.6: icmp: echo request (id:c98c seq:0) [icmp cksum ok] (ttl 255, id 8769, len 84, bad ip cksum 0! -> a5b) grep '[0-9] 127.0.0.1 > 10.6.6.6: icmp: echo request .* \[ttl 1\]' lo17.tcpdump 13:46:07.811788 127.0.0.1 > 10.6.6.6: icmp: echo request (id:c98c seq:0) [icmp cksum ok] [ttl 1] (id 8769, len 84, bad ip cksum 0! -> 85c) ==== run-bpf-local-18 ==== # Check that the ping packet went through loopback. grep '127.0.0.1 > 127.0.0.1: icmp: echo request' lo18.tcpdump 13:46:09.988271 127.0.0.1 > 127.0.0.1: icmp: echo request (id:3604 seq:0) [icmp cksum ok] (ttl 255, id 64784, len 84, bad ip cksum 0! -> c095) ==== run-bpf-loop-18 ==== # Check that the ping packet went multiple times through loopback. grep '[0-9] 127.0.0.1 > 10.6.6.6: icmp: echo request .*ttl 255,' lo18.tcpdump 13:46:10.073031 127.0.0.1 > 10.6.6.6: icmp: echo request (id:6447 seq:0) [icmp cksum ok] (ttl 255, id 44252, len 84, bad ip cksum 0! -> 7fbf) grep '[0-9] 127.0.0.1 > 10.6.6.6: icmp: echo request .* \[ttl 1\]' lo18.tcpdump 13:46:10.074724 127.0.0.1 > 10.6.6.6: icmp: echo request (id:6447 seq:0) [icmp cksum ok] [ttl 1] (id 44252, len 84, bad ip cksum 0! -> 7dc0) ==== run-bpf-rdomain-loop-17 ==== # Check the ping packet went multiple times in routing domains. grep '[0-9] 127.0.0.1 > 10.7.7.7: icmp: echo request .*ttl 255,' lo17.tcpdump 13:46:14.448932 127.0.0.1 > 10.7.7.7: icmp: echo request (id:0d82 seq:0) [icmp cksum ok] (ttl 255, id 31592, len 84, bad ip cksum 0! -> b031) ! grep '[0-9] 127.0.0.1 > 10.7.7.7: icmp: echo request .*ttl 254,' lo17.tcpdump grep '[0-9] 127.0.0.1 > 10.7.7.7: icmp: echo request .* \[ttl 1\]' lo17.tcpdump 13:46:14.449923 127.0.0.1 > 10.7.7.7: icmp: echo request (id:0d82 seq:0) [icmp cksum ok] [ttl 1] (id 31592, len 84, bad ip cksum 0! -> ae32) ==== run-bpf-rdomain-loop-18 ==== # Check the ping packet went multiple times in routing domains. grep '[0-9] 127.0.0.1 > 10.7.7.7: icmp: echo request .*ttl 254,' lo18.tcpdump 13:46:14.448950 127.0.0.1 > 10.7.7.7: icmp: echo request (id:0d82 seq:0) [icmp cksum ok] (ttl 254, id 31592, len 84, bad ip cksum 0! -> b131) grep '[0-9] 127.0.0.1 > 10.7.7.7: icmp: echo request .*ttl 2,' lo18.tcpdump 13:46:14.449919 127.0.0.1 > 10.7.7.7: icmp: echo request (id:0d82 seq:0) [icmp cksum ok] (ttl 2, id 31592, len 84, bad ip cksum 0! -> ad32) ! grep '[0-9] 127.0.0.1 > 10.7.7.7: icmp: echo request .* \[ttl 1\]' lo18.tcpdump ==== unconfig ==== # Destroy interfaces. doas -n /sbin/ifconfig lo17 rdomain 17 doas -n /sbin/ifconfig lo17 inet 127.0.0.1 delete doas -n /sbin/ifconfig lo17 inet 127.0.0.17 delete doas -n /sbin/ifconfig lo17 destroy doas -n /sbin/ifconfig lo18 rdomain 18 doas -n /sbin/ifconfig lo18 inet 127.0.0.1 delete doas -n /sbin/ifconfig lo18 inet 127.0.0.18 delete doas -n /sbin/ifconfig lo18 destroy rm -f stamp-ifconfig