1.0.10.38: fix get-host-by-address on Darwin
authorRudi Schlatte <rudi@constantly.at>
Mon, 8 Oct 2007 06:19:26 +0000 (06:19 +0000)
committerRudi Schlatte <rudi@constantly.at>
Mon, 8 Oct 2007 06:19:26 +0000 (06:19 +0000)
  sockaddr_in has a length field on Darwin but not on linux

contrib/sb-bsd-sockets/constants.lisp
contrib/sb-bsd-sockets/name-service.lisp
version.lisp-expr

index 2fcb27c..cf0be5b 100644 (file)
  (:structure in-addr ("struct in_addr"
                       ((array (unsigned 8)) addr "u_int32_t" "s_addr")))
  (:structure sockaddr-in ("struct sockaddr_in"
+                          #+darwin ((unsigned 8) len "__uint8_t" "sin_len")
                           (integer family "sa_family_t" "sin_family")
                           ;; These two could be in-port-t and
                           ;; in-addr-t, but then we'd throw away the
index ff9279b..3378ffa 100644 (file)
@@ -35,7 +35,7 @@
                           (#.sockint::af-inet
                            ;; CLH: Work around x86-64 darwin bug here.
                            ;; The length is reported as 8, when it should be 4.
-                           ;; FIXME: this is rumored to be fix in 10.5
+                           ;; FIXME: this is rumored to be fixed in 10.5
                            #+(and darwin x86-64)
                            (progn
                              (assert (or (= length 4) (= length 8)))
@@ -125,6 +125,7 @@ weird stuff - see gethostbyname(3) or getaddrinfo(3) for the details."
   (assert (= (length address) 4))
   (sockint::with-sockaddr-in sockaddr ()
     (sb-alien:with-alien ((host-buf (array char #.ni-max-host)))
+      #+darwin (setf (sockint::sockaddr-in-len sockaddr) 16)
       (setf (sockint::sockaddr-in-family sockaddr) sockint::af-inet)
       (dotimes (i 4)
         (setf (sb-alien:deref (sockint::sockaddr-in-addr sockaddr) i)
index e93ddf1..db3d8c2 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.10.37"
+"1.0.10.38"