Break apart the list of functions defined in universal.c by perl
[p5sagit/p5-mst-13.2.git] / ext / Socket / Socket.xs
index 48f30d9..076297f 100644 (file)
@@ -182,7 +182,7 @@ my_inet_aton(register const char *cp, struct in_addr *addr)
 
 
 static int
-not_here(char *s)
+not_here(const char *s)
 {
     croak("Socket::%s not implemented on this architecture", s);
     return -1;
@@ -233,7 +233,8 @@ inet_aton(host)
        struct hostent * phe;
        int ok = (*host != '\0') && inet_aton(host, &ip_address);
 
-       if (!ok && (phe = gethostbyname(host))) {
+       if (!ok && (phe = gethostbyname(host)) &&
+                       phe->h_addrtype == AF_INET && phe->h_length == 4) {
                Copy( phe->h_addr, &ip_address, phe->h_length, char );
                ok = 1;
        }