From 8251ff820858623797c7ec2785424d6704db7e2b Mon Sep 17 00:00:00 2001 From: Nick Ing-Simmons Date: Thu, 7 Aug 1997 00:00:00 +0000 Subject: [PATCH] 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 --- ext/IO/lib/IO/Socket.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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') -- 2.34.1