-# $OpenBSD: Makefile.inc,v 1.7 2021/12/12 10:56:49 bluhm Exp $
+# $OpenBSD: Makefile.inc,v 1.8 2021/12/12 21:16:53 bluhm Exp $
# The following ports must be installed for the regression tests:
# p5-BSD-Socket-Splice perl interface to OpenBSD socket splicing
-# p5-IO-Socket-INET6 object interface for AF_INET and AF_INET6 domain sockets
# p5-Socket6 Perl defines relating to AF_INET6 sockets
#
# Check wether all required perl packages are installed. If some
-# $OpenBSD: Client.pm,v 1.5 2017/12/18 17:01:27 bluhm Exp $
+# $OpenBSD: Client.pm,v 1.6 2021/12/12 21:16:53 bluhm Exp $
# Copyright (c) 2010-2017 Alexander Bluhm <bluhm@openbsd.org>
#
use Socket qw(IPPROTO_TCP TCP_NODELAY);
use Socket6;
use IO::Socket;
-use IO::Socket::INET6;
+use IO::Socket::IP -register;
use constant SO_BINDANY => 0x1000;
sub new {
my $cs;
if ($self->{bindany}) {
- do { local $> = 0; $cs = IO::Socket::INET6->new(
+ do { local $> = 0; $cs = IO::Socket->new(
Type => $self->{socktype},
Proto => $self->{protocol},
Domain => $self->{domain},
- Blocking => ($self->{nonblocking} ? 0 : 1),
) } or die ref($self), " socket connect failed: $!";
do { local $> = 0; $cs->setsockopt(SOL_SOCKET, SO_BINDANY, 1) }
or die ref($self), " setsockopt SO_BINDANY failed: $!";
$cs->bind($rres[3])
or die ref($self), " bind failed: $!";
} elsif ($self->{bindaddr} || $self->{bindport}) {
- do { local $> = 0; $cs = IO::Socket::INET6->new(
+ do { local $> = 0; $cs = IO::Socket->new(
Type => $self->{socktype},
Proto => $self->{protocol},
Domain => $self->{domain},
- Blocking => ($self->{nonblocking} ? 0 : 1),
LocalAddr => $self->{bindaddr},
LocalPort => $self->{bindport},
) } or die ref($self), " socket connect failed: $!";
sub child {
my $self = shift;
- my $cs = $self->{cs} || do { local $> = 0; IO::Socket::INET6->new(
+ my $cs = $self->{cs} || do { local $> = 0; IO::Socket->new(
Type => $self->{socktype},
Proto => $self->{protocol},
Domain => $self->{domain},
- Blocking => ($self->{nonblocking} ? 0 : 1),
) } or die ref($self), " socket connect failed: $!";
if ($self->{oobinline}) {
setsockopt($cs, SOL_SOCKET, SO_OOBINLINE, pack('i', 1))
print STDERR "connect peer: ",$cs->peerhost()," ",$cs->peerport(),"\n";
$self->{bindaddr} = $cs->sockhost();
$self->{bindport} = $cs->sockport();
+ if ($self->{nonblocking}) {
+ $cs->blocking(0)
+ or die ref($self), " set non-blocking connect failed: $!";
+ }
open(STDOUT, '>&', $cs)
or die ref($self), " dup STDOUT failed: $!";
-# $OpenBSD: Makefile,v 1.23 2020/12/17 00:51:12 bluhm Exp $
+# $OpenBSD: Makefile,v 1.24 2021/12/12 21:16:53 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
# p5-Socket6 Perl defines relating to AF_INET6 sockets
#
# Check wether all required perl packages are installed. If some
# are missing print a warning and skip the tests, but do not fail.
PERL_REQUIRE != perl -Mstrict -Mwarnings -e ' \
- eval { require IO::Socket::INET6 } or print $@; \
eval { require Socket6 } or print $@; \
'
.if ! empty(PERL_REQUIRE)
route -n get -inet6 ${FAKE_ADDR6} | grep 'gateway: ${REMOTE_ADDR6}$$'
ssh ${REMOTE_SSH} ${SUDO} pfctl -sr | grep '^anchor "regress" all$$'
ssh ${REMOTE_SSH} ${SUDO} pfctl -si | grep '^Status: Enabled '
- ssh ${REMOTE_SSH} perl -MIO::Socket::INET6 -MSocket6 -e 1
+ ssh ${REMOTE_SSH} perl -MSocket6 -e 1
.include <bsd.regress.mk>
-# $OpenBSD: Packet.pm,v 1.4 2017/12/18 17:01:27 bluhm Exp $
+# $OpenBSD: Packet.pm,v 1.5 2021/12/12 21:16:53 bluhm Exp $
# Copyright (c) 2010-2017 Alexander Bluhm <bluhm@openbsd.org>
#
use Socket;
use Socket6;
use IO::Socket;
-use IO::Socket::INET6;
+use IO::Socket::IP -register;
use constant IPPROTO_DIVERT => 258;
and die ref($self), " system '@cmd' failed: $?";
}
- my $ds = do { local $> = 0; IO::Socket::INET6->new(
+ my $ds = do { local $> = 0; IO::Socket->new(
Type => Socket::SOCK_RAW,
Proto => IPPROTO_DIVERT,
Domain => $self->{domain},
-# $OpenBSD: Server.pm,v 1.5 2017/12/18 17:01:27 bluhm Exp $
+# $OpenBSD: Server.pm,v 1.6 2021/12/12 21:16:53 bluhm Exp $
# Copyright (c) 2010-2017 Alexander Bluhm <bluhm@openbsd.org>
#
use Socket qw(IPPROTO_TCP TCP_NODELAY);
use Socket6;
use IO::Socket;
-use IO::Socket::INET6;
+use IO::Socket::IP -register;
sub new {
my $class = shift;
and die ref($self), " system '@cmd' failed: $?";
}
- my $ls = do { local $> = 0; IO::Socket::INET6->new(
+ my $ls = do { local $> = 0; IO::Socket->new(
Type => $self->{socktype},
Proto => $self->{protocol},
ReuseAddr => 1,
print STDERR "accept peer: ",$as->peerhost()," ",
$as->peerport(),"\n";
}
- $as->blocking($self->{nonblocking} ? 0 : 1)
- or die ref($self), " non-blocking accept failed: $!";
+ if ($self->{nonblocking}) {
+ $as->blocking(0)
+ or die ref($self), " set non-blocking accept failed: $!";
+ }
open(STDIN, '<&', $as)
or die ref($self), " dup STDIN failed: $!";