From: Nick Ing-Simmons Date: Thu, 7 Aug 1997 00:00:00 +0000 (+0000) Subject: icmp tweak for IO::Socket X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8251ff820858623797c7ec2785424d6704db7e2b;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/ext/IO/lib/IO/Socket.pm b/ext/IO/lib/IO/Socket.pm index 171042c..ab19170 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')