From 236b1001f1d28caca1860b5de2c3095383276c54 Mon Sep 17 00:00:00 2001 From: Rudi Schlatte Date: Mon, 8 Oct 2007 06:19:26 +0000 Subject: [PATCH] 1.0.10.38: fix get-host-by-address on Darwin sockaddr_in has a length field on Darwin but not on linux --- contrib/sb-bsd-sockets/constants.lisp | 1 + contrib/sb-bsd-sockets/name-service.lisp | 3 ++- version.lisp-expr | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/contrib/sb-bsd-sockets/constants.lisp b/contrib/sb-bsd-sockets/constants.lisp index 2fcb27c..cf0be5b 100644 --- a/contrib/sb-bsd-sockets/constants.lisp +++ b/contrib/sb-bsd-sockets/constants.lisp @@ -130,6 +130,7 @@ (: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 diff --git a/contrib/sb-bsd-sockets/name-service.lisp b/contrib/sb-bsd-sockets/name-service.lisp index ff9279b..3378ffa 100644 --- a/contrib/sb-bsd-sockets/name-service.lisp +++ b/contrib/sb-bsd-sockets/name-service.lisp @@ -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) diff --git a/version.lisp-expr b/version.lisp-expr index e93ddf1..db3d8c2 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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" -- 1.7.10.4