summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNick Ing-Simmons <Nick.Ing-Simmons@tiuk.ti.com>1997-08-07 00:00:00 +0000
committerTim Bunce <Tim.Bunce@ig.co.uk>1997-08-07 00:00:00 +1200
commit8251ff820858623797c7ec2785424d6704db7e2b (patch)
treeabc3f55c021e3c875c04567af40dd85eaea86eca /ext
parent7e24002c4853ca0b85feacbb2d843aecc82e5441 (diff)
downloadperl-8251ff820858623797c7ec2785424d6704db7e2b.tar.gz
icmp tweak for IO::Socket
Following patch allows use of : my $sock = IO::Socket::INET->new(Proto => 'icmp'); To create an ICMP protocol socket, as use for traditional 'ping'. On UNIX at least only super-user can do this. p5p-msgid: 199707041240.NAA21484@pluto.tiuk.ti.com
Diffstat (limited to 'ext')
-rw-r--r--ext/IO/lib/IO/Socket.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/IO/lib/IO/Socket.pm b/ext/IO/lib/IO/Socket.pm
index 171042cccc..ab1917031d 100644
--- a/ext/IO/lib/IO/Socket.pm
+++ b/ext/IO/lib/IO/Socket.pm
@@ -380,6 +380,7 @@ IO::Socket::INET->register_domain( AF_INET );
my %socket_type = ( tcp => SOCK_STREAM,
udp => SOCK_DGRAM,
+ icmp => SOCK_RAW,
);
=head2 IO::Socket::INET
@@ -557,7 +558,7 @@ sub configure {
}
else {
return _error($fh,'Cannot determine remote port')
- unless($rport || $type == SOCK_DGRAM);
+ unless($rport || $type == SOCK_DGRAM || $type == SOCK_RAW);
if($type == SOCK_STREAM || defined $raddr) {
return _error($fh,'Bad peer address')