summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2017-09-04 22:40:01 +0000
committerbluhm <bluhm@openbsd.org>2017-09-04 22:40:01 +0000
commit0c490069222b936fd71ab8e022f6f8182d6a912c (patch)
tree1e25d0134a592a02c4d04123563767699d8e26ac
parentLet octmmc(4) attach on revision 7890 controller. (diff)
downloadwireguard-openbsd-0c490069222b936fd71ab8e022f6f8182d6a912c.tar.xz
wireguard-openbsd-0c490069222b936fd71ab8e022f6f8182d6a912c.zip
Run divert-packet tests also for IPv6.
-rw-r--r--regress/sys/net/pf_divert/Makefile11
-rw-r--r--regress/sys/net/pf_divert/Packet.pm6
2 files changed, 11 insertions, 6 deletions
diff --git a/regress/sys/net/pf_divert/Makefile b/regress/sys/net/pf_divert/Makefile
index 3262909db12..c8c5fb57960 100644
--- a/regress/sys/net/pf_divert/Makefile
+++ b/regress/sys/net/pf_divert/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.16 2017/08/15 04:11:20 bluhm Exp $
+# $OpenBSD: Makefile,v 1.17 2017/09/04 22:40:01 bluhm Exp $
# The following ports must be installed for the regression tests:
# p5-IO-Socket-INET6 object interface for AF_INET and AF_INET6 domain sockets
@@ -87,9 +87,12 @@ TARGETS ?= inet-args-tcp-to inet6-args-tcp-to \
inet-reuse-rip-reply-to-to inet6-reuse-rip-reply-to-to \
inet-reuse-rip-reply-to-reply inet6-reuse-rip-reply-to-reply \
inet-reuse-rip-reply-to-reply-to inet6-reuse-rip-reply-to-reply-to \
- inet-args-udp-packet-in inet-args-udp-packet-out \
- inet-args-udp-packet-in-init inet-args-udp-packet-in-resp \
- inet-args-udp-packet-out-init inet-args-udp-packet-out-resp
+ inet-args-udp-packet-in inet6-args-udp-packet-in \
+ inet-args-udp-packet-out inet6-args-udp-packet-out \
+ inet-args-udp-packet-in-init inet6-args-udp-packet-in-init \
+ inet-args-udp-packet-in-resp inet6-args-udp-packet-in-resp \
+ inet-args-udp-packet-out-init inet6-args-udp-packet-out-init \
+ inet-args-udp-packet-out-resp inet6-args-udp-packet-out-resp
REGRESS_TARGETS = ${TARGETS:S/^/run-regress-/}
CLEANFILES += *.log *.port ktrace.out stamp-*
diff --git a/regress/sys/net/pf_divert/Packet.pm b/regress/sys/net/pf_divert/Packet.pm
index ac7f3e7017a..09485aa93a3 100644
--- a/regress/sys/net/pf_divert/Packet.pm
+++ b/regress/sys/net/pf_divert/Packet.pm
@@ -1,4 +1,4 @@
-# $OpenBSD: Packet.pm,v 1.1 2017/08/15 04:11:20 bluhm Exp $
+# $OpenBSD: Packet.pm,v 1.2 2017/09/04 22:40:01 bluhm Exp $
# Copyright (c) 2010-2017 Alexander Bluhm <bluhm@openbsd.org>
#
@@ -58,8 +58,10 @@ sub new {
my $divertdir = 0;
$divertdir |= IPPROTO_DIVERT_INIT if $self->{divertinit};
$divertdir |= IPPROTO_DIVERT_RESP if $self->{divertresp};
+ my $level = $self->{af} eq "inet" ? IPPROTO_IP :
+ $self->{af} eq "inet6" ? IPPROTO_IPV6 : undef;
if ($divertdir) {
- setsockopt($ds, IPPROTO_IP, IP_DIVERTFL, pack('i', $divertdir))
+ setsockopt($ds, $level, IP_DIVERTFL, pack('i', $divertdir))
or die ref($self), " set divert flag failed: $!";
}
$self->{ds} = $ds;