Your message dated Wed, 1 Mar 2006 17:38:27 +0100
with message-id <[EMAIL PROTECTED]>
and subject line Bug#309774: [patch] sysdeps/posix/getaddrinfo.c incorrectly 
checks for sa_len
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: glibc
Version: 2.3.5-1
Severity: normal
Tags: experimental,patch

Hi,

Neal Walfield has reported the following problem to libc-alpha
(http://sources.redhat.com/ml/libc-alpha/2005-05/msg00044.html):

> sysdeps/posix/getaddrinfo.c incorrectly checks for sa_len.  It should
> check if _HAVE_SA_LEN is defined, not if SALEN is true as is done in,
> for example, sysdeps/generic/ifreq.h .
>
> I encountered this while debugging the Orbit2 test suite on the Hurd.
> It checks if two addresses are the same using the following idiom:
>
>   const struct sockaddr *saddr;
>   struct addrinfo hints, *result = NULL;
>   ...
>   getaddrinfo(link_get_local_hostname(), NULL, &hints, &local _addr) != 0)
>   ...
>   if (af == AF_INET) {
>       if (!memcmp ((struct sockaddr_in *)result->ai_addr,
>                    (struct sockaddr_in *)saddr,
>                    result->ai_addrlen))

He provided a patch (attached as .dpatch) which got applied by Roland
McGrath on the trunk today.  Neal punted the decision whether to file
this in bugzilla in order to get it fixed for the 2.3 branch to me, so I
am asking here what you guys prefer.


thanks,

Michael

-- 
Michael Banck
Debian Developer
[EMAIL PROTECTED]
http://www.advogato.org/person/mbanck/diary.html
#! /bin/sh -e

# All lines beginning with `# DP:' are a description of the patch.
# DP: Description: Fix sa_len checking
# DP: Related bugs:
# DP: Dpatch author: Michael Banck <[EMAIL PROTECTED]>
# DP: Patch author: Neal Walfield <[EMAIL PROTECTED]>
# DP: Upstream status: In CVS
# DP: Status Details: Fixed in trunk, fix in branch possible if 
# DP:                 requested through upstream bugzilla
# DP: Date: 2005-05-18

PATCHLEVEL=0

if [ $# -ne 2 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch) patch -d "$2" -f --no-backup-if-mismatch -p$PATCHLEVEL < $0;;
    -unpatch) patch -d "$2" -f --no-backup-if-mismatch -R -p$PATCHLEVEL < $0;;
    *)
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
        exit 1
esac
exit 0


2005-05-17  Neal H. Walfield  <[EMAIL PROTECTED]>

        * sysdeps/posix/getaddrinfo.c (gaih_local): Check if _HAVE_SA_LEN
        is defined, not if SALEN.
        (gaih_inet): Likewise.

--- ./sysdeps/posix/getaddrinfo.c.orig  2005-05-17 12:16:21.000000000 +0100
+++ ./sysdeps/posix/getaddrinfo.c       2005-05-17 12:30:13.000000000 +0100
@@ -193,10 +193,10 @@ gaih_local (const char *name, const stru
   (*pai)->ai_addrlen = sizeof (struct sockaddr_un);
   (*pai)->ai_addr = (void *) (*pai) + sizeof (struct addrinfo);
 
-#if SALEN
+#ifdef _HAVE_SA_LEN
   ((struct sockaddr_un *) (*pai)->ai_addr)->sun_len =
     sizeof (struct sockaddr_un);
-#endif /* SALEN */
+#endif /* _HAVE_SA_LEN */
 
   ((struct sockaddr_un *)(*pai)->ai_addr)->sun_family = AF_LOCAL;
   memset(((struct sockaddr_un *)(*pai)->ai_addr)->sun_path, 0, UNIX_PATH_MAX);
@@ -859,9 +859,9 @@ gaih_inet (const char *name, const struc
            (*pai)->ai_canonname = canon;
            canon = NULL;
 
-#if SALEN
+#ifdef _HAVE_SA_LEN
            (*pai)->ai_addr->sa_len = socklen;
-#endif /* SALEN */
+#endif /* _HAVE_SA_LEN */
            (*pai)->ai_addr->sa_family = family;
 
            if (family == AF_INET6)


--- End Message ---
--- Begin Message ---
Version: 2.3.6-1

This patch has been merged in version 2.3.6. Closing the bug.


-- 
  .''`.  Aurelien Jarno             | GPG: 1024D/F1BCDB73
 : :' :  Debian developer           | Electrical Engineer
 `. `'   [EMAIL PROTECTED]         | [EMAIL PROTECTED]
   `-    people.debian.org/~aurel32 | www.aurel32.net

--- End Message ---

Reply via email to