fix getnameinfo flags
Alexander Hartmaier [Wed, 11 Jan 2017 15:29:24 +0000 (16:29 +0100)]
NI_DGRAM isn't needed because it's a TCP, not UDP socket and we don't care
about the service name
NIx_NOSERV is a xflag and has to be specified as the third parameter

lib/Catalyst/Request.pm

index d1a6d10..12dff26 100644 (file)
@@ -1,6 +1,6 @@
 package Catalyst::Request;
 
-use Socket qw( getaddrinfo getnameinfo AI_NUMERICHOST NI_DGRAM NIx_NOSERV );
+use Socket qw( getaddrinfo getnameinfo AI_NUMERICHOST NIx_NOSERV );
 use Carp;
 use utf8;
 use URI::http;
@@ -448,8 +448,9 @@ has hostname => (
     }
     ( $err, my $hostname ) = getnameinfo(
         $sockaddr->{addr},
+        0,
         # we are only interested in the hostname, not the servicename
-        NI_DGRAM|NIx_NOSERV
+        NIx_NOSERV
     );
     if ( $err ) {
         $self->_log->warn("resolve of hostname failed: $err");