Skip Menu |

This queue is for tickets about the Socket CPAN distribution.

Report information
The Basics
Id: 105947
Status: resolved
Priority: 0/
Queue: Socket

People
Owner: Nobody in particular
Requestors: BULKDD [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 2.021



Subject: [PATCH] respect HAS_GETHOSTBYNAME before using gethostbyname
On a freak platform configuration without sockets, I noticed Socket uses gethostbyname without testing Config.pm/config.h's HAS_GETHOSTBYNAME. Thus Socket fails at link time with unresolved symbol. This patch lets Socket compile on such a freak platform (I dont care about tests passing on a no sockets configuration).
Subject: 0001-respect-HAS_GETHOSTBYNAME-before-using-gethostbyname.patch
From 0b982f2bcabb11d5889fdf7fca2186db57638510 Mon Sep 17 00:00:00 2001 From: Daniel Dragan <bulk88@hotmail.com> Date: Sun, 19 Jul 2015 15:38:57 -0400 Subject: [PATCH] respect HAS_GETHOSTBYNAME before using gethostbyname --- cpan/Socket/Socket.xs | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpan/Socket/Socket.xs b/cpan/Socket/Socket.xs index 50a0f31..28f1ce6 100644 --- a/cpan/Socket/Socket.xs +++ b/cpan/Socket/Socket.xs @@ -664,13 +664,13 @@ inet_aton(host) ST(0) = sv_2mortal(newSVpvn((char *)&ip_address, sizeof(ip_address))); XSRETURN(1); } - +#ifdef HAS_GETHOSTBYNAME phe = gethostbyname(host); if (phe && phe->h_addrtype == AF_INET && phe->h_length == 4) { ST(0) = sv_2mortal(newSVpvn((char *)phe->h_addr, phe->h_length)); XSRETURN(1); } - +#endif XSRETURN_UNDEF; } -- 1.7.9.msysgit.0
On Sun Jul 19 15:50:07 2015, BULKDD wrote: Show quoted text
> On a freak platform configuration without sockets, I noticed Socket > uses gethostbyname without testing Config.pm/config.h's > HAS_GETHOSTBYNAME. Thus Socket fails at link time with unresolved > symbol. This patch lets Socket compile on such a freak platform (I > dont care about tests passing on a no sockets configuration).
Applied. Thanks. -- Paul Evans
Fixed in 2.021 -- Paul Evans