summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xemergencyd.pl6
1 files changed, 2 insertions, 4 deletions
diff --git a/emergencyd.pl b/emergencyd.pl
index 6920e95..a0d5aa9 100755
--- a/emergencyd.pl
+++ b/emergencyd.pl
@@ -115,7 +115,6 @@ sub read_keys {
}
read_keys;
-my $proto = getprotobyname("udp") or die "Can't resolve udp protocol: $!";
my $port;
if ( defined($opts{p}) ) {
$port = $opts{p};
@@ -124,7 +123,7 @@ if ( defined($opts{p}) ) {
$port = DEFAULT_PORT;
}
-socket my $socket, PF_INET6, SOCK_DGRAM, $proto
+socket my $socket, PF_INET6, SOCK_DGRAM, 0
or die "Can't create socket: $!";
if ( defined(*IPV6_V6ONLY{CODE}) ) {
setsockopt $socket, IPPROTO_IPV6, IPV6_V6ONLY, 0
@@ -242,8 +241,7 @@ sub cmd_shel {
my $port = shift or die [ "!BAD", "Missing argument to SHEL" ];
die [ "!BAD", "Invalid port number (SHEL command) $port" ]
unless $port =~ /^\d+$/;
- my $proto = getprotobyname("tcp") or die "Can't resolve tcp protocol: $!";
- socket my $socket, PF_INET6, SOCK_STREAM, $proto
+ socket my $socket, PF_INET6, SOCK_STREAM, 0
or die "Can't create socket: $!";
my $flags;
$flags = fcntl ($socket, F_GETFL, 0);