Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-2]: src/lib/libc/net Pull up revision 1.29 (requested by kleink i...
details: https://anonhg.NetBSD.org/src/rev/b07658059f83
branches: netbsd-2
changeset: 563770:b07658059f83
user: riz <riz%NetBSD.org@localhost>
date: Tue Jul 05 18:34:34 2005 +0000
description:
Pull up revision 1.29 (requested by kleink in ticket #2015):
struct netent.n_net used to be an unsigned long integer.
In XNS5, and subsequently in POSIX-2001 it was changed to socklen_t.
To accomodate for this while preserving binary compatibility with the
old interface, prepend or append 32 bits of padding, depending on
the (LP64 data model) architecture's endianness. Fixes PR
standards/21411 from Ben Harris.
This should be deleted the next time the libc major number is
incremented.
Also, update getnetbyaddr(3)'s `net' argument accordingly.
diffstat:
lib/libc/net/getnetnamadr.c | 18 +++++++++++++++---
1 files changed, 15 insertions(+), 3 deletions(-)
diffs (53 lines):
diff -r 56829273450d -r b07658059f83 lib/libc/net/getnetnamadr.c
--- a/lib/libc/net/getnetnamadr.c Tue Jul 05 18:34:32 2005 +0000
+++ b/lib/libc/net/getnetnamadr.c Tue Jul 05 18:34:34 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: getnetnamadr.c,v 1.28 2004/01/29 01:39:15 lukem Exp $ */
+/* $NetBSD: getnetnamadr.c,v 1.28.4.1 2005/07/05 18:34:34 riz Exp $ */
/* Copyright (c) 1993 Carlos Leandro and Rui Salgueiro
* Dep. Matematica Universidade de Coimbra, Portugal, Europe
@@ -43,7 +43,7 @@
static char sccsid_[] = "from getnetnamadr.c 1.4 (Coimbra) 93/06/03";
static char rcsid[] = "Id: getnetnamadr.c,v 8.8 1997/06/01 20:34:37 vixie Exp ";
#else
-__RCSID("$NetBSD: getnetnamadr.c,v 1.28 2004/01/29 01:39:15 lukem Exp $");
+__RCSID("$NetBSD: getnetnamadr.c,v 1.28.4.1 2005/07/05 18:34:34 riz Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -237,6 +237,12 @@
if (strcasecmp(in, "IN-ADDR.ARPA") != 0)
goto next_alias;
net_entry.n_aliases++;
+#if (defined(__sparc__) && defined(_LP64)) || \
+ defined(__alpha__) || \
+ (defined(__i386__) && defined(_LP64)) || \
+ (defined(__sh__) && defined(_LP64))
+ net_entry.__n_pad0 = 0;
+#endif
return (&net_entry);
}
h_errno = TRY_AGAIN;
@@ -354,7 +360,7 @@
struct netent *
getnetbyaddr(net, net_type)
- u_long net;
+ uint32_t net;
int net_type;
{
struct netent *np;
@@ -600,6 +606,12 @@
if (p != NULL)
*p++ = '\0';
net_entry.n_net = inet_network(cp);
+#if (defined(__sparc__) && defined(_LP64)) || \
+ defined(__alpha__) || \
+ (defined(__i386__) && defined(_LP64)) || \
+ (defined(__sh__) && defined(_LP64))
+ net_entry.__n_pad0 = 0;
+#endif
net_entry.n_addrtype = AF_INET;
q = net_entry.n_aliases = net_aliases;
if (p != NULL) {
Home |
Main Index |
Thread Index |
Old Index