Attached are two small bugfixes to getaddrinfo()
Please apply,
Thanks.
--
Paul "LeoNerd" Evans
leonerd@leonerd.org.uk
ICQ# 4135350 | Registered Linux# 179460
http://www.leonerd.org.uk/
From
61fdece8ab9a729206f2633f47e25afd6f05af6a Mon Sep 17 00:00:00 2001
From: Paul "LeoNerd" Evans <leonerd@leonerd.org.uk>
Date: Mon, 24 Jan 2011 18:58:40 +0000
Subject: [PATCH 2/3] canonname should only be present on the first returned result
Signed-off-by: H.Merijn Brand <h.m.brand@xs4all.nl>
=item canonname => STRING
The canonical name for the host if the C<AI_CANONNAME> flag was provided, or
-C<undef> otherwise.
+C<undef> otherwise. This field will only be present on the first returned
+address.
=back
socktype => $socktype,
protocol => $protocol,
addr => Socket::pack_sockaddr_in( $port, $addr ),
- canonname => $canonname,
+ canonname => undef,
};
}
}
+ # Only supply canonname for the first result
+ if( defined $canonname ) {
+ $ret[0]->{canonname} = $canonname;
+ }
+
return ( fake_makeerr( 0 ), @ret );
}
}
Zero(&hints_s, sizeof hints_s, char);
+ hints_s.ai_family = PF_UNSPEC;
if(hints && SvOK(hints)) {
HV *hintshash;