bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug found (in libc)


From: Robert Millan
Subject: bug found (in libc)
Date: Sat, 26 Apr 2003 19:30:01 +0200
User-agent: Mutt/1.5.4i

tag 187391 patch
thanks

ok, by differing the bits/sockaddr.h from GNU and from
GNU/Linux it seems the final conclusion on this bug is:

the problem can be fixed by simply appliing this patch
to bits/sockaddr.h:

--- bits/sockaddr.h.old 2002-11-20 01:41:35.000000000 +0100
+++ bits/sockaddr.h     2003-04-26 14:52:38.000000000 +0200
@@ -33,7 +33,6 @@
    `struct sockaddr_in', `struct sockaddr_un', etc.  */
  
 #define        __SOCKADDR_COMMON(sa_prefix)    \
-  unsigned char sa_prefix##len;                \
   sa_family_t sa_prefix##family
  
 #define __SOCKADDR_COMMON_SIZE (2 * sizeof (unsigned char))


However, there are more differences between both versions:

--- /include/bits/sockaddr.h    2002-11-20 01:41:35.000000000 +0100
+++ /gli/usr/include/bits/sockaddr.h    2003-04-19 20:56:39.000000000 +0200
@@ -1,5 +1,5 @@
-/* Definition of `struct sockaddr_*' common members.  4.4 BSD version.
-   Copyright (C) 1995, 1996, 1997, 1998, 2001 Free Software Foundation, Inc.
+/* Definition of `struct sockaddr_*' common members.  Generic/4.2 BSD version.
+   Copyright (C) 1995,1996,1997,1998,2000,2001 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
  
    The GNU C Library is free software; you can redistribute it and/or
@@ -26,18 +26,15 @@
  
  
 /* POSIX.1g specifies this type name for the `sa_family' member.  */
-typedef unsigned char sa_family_t;
+typedef unsigned short int sa_family_t;
  
 /* This macro is used to declare the initial common members
    of the data types used for socket addresses, `struct sockaddr',
    `struct sockaddr_in', `struct sockaddr_un', etc.  */
  
-#define        __SOCKADDR_COMMON(sa_prefix)    \
-  unsigned char sa_prefix##len;                \
+#define        __SOCKADDR_COMMON(sa_prefix) \
   sa_family_t sa_prefix##family
                                                                                
-#define __SOCKADDR_COMMON_SIZE (2 * sizeof (unsigned char))
-
-#define _HAVE_SA_LEN   1       /* We have the sa_len field.  */
+#define __SOCKADDR_COMMON_SIZE (sizeof (unsigned short int))
                                                                                
 #endif /* bits/sockaddr.h */

which indicate a disparity on what the POSIX 1003.1g standard
says. is sa_family_t an unsigned char or an unsigned short int?

you can fix this bug with the first diff. but someone should
take a look at POSIX.1g to find out which of short int or char
is the correct value.

-- 
Robert Millan

make: *** No rule to make target `war'.  Stop.

Another world is possible - Just say no to genocide




reply via email to

[Prev in Thread] Current Thread [Next in Thread]