summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/getnetbynis.c
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2005-05-15 20:15:15 +0000
committerume <ume@FreeBSD.org>2005-05-15 20:15:15 +0000
commit7a6cd620d08df24bc7c27e2a13017a1f63f004b2 (patch)
tree309b5291b90b8bac584d010fde9db8ed4db9a767 /lib/libc/net/getnetbynis.c
parentdd14237cdafb5e0124ab3277ac0ac8f9eaf03aa0 (diff)
downloadFreeBSD-src-7a6cd620d08df24bc7c27e2a13017a1f63f004b2.zip
FreeBSD-src-7a6cd620d08df24bc7c27e2a13017a1f63f004b2.tar.gz
- The ai_addrlen of a struct addrinfo used to be a size_t, per
RFC 2553. In XNS5.2, and subsequently in POSIX-2001 and RFC 3493, it was changed to a socklen_t. And, the n_net of a struct netent used to be an unsigned long integer. In XNS5, and subsequently in POSIX-2001, it was changed to an uint32_t. To accomodate for this while preserving ABI compatibility with the old interface, we need to prepend or append 32 bits of padding, depending on the (LP64) architecture's endianness. - Correct 1st argument of getnetbyaddr() to uint32_t on 32 bit arch. Stay as is on 64 bit arch for ABI backward compatibility for now. Reviewed by: das, peter MFC after: 2 weeks
Diffstat (limited to 'lib/libc/net/getnetbynis.c')
-rw-r--r--lib/libc/net/getnetbynis.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/libc/net/getnetbynis.c b/lib/libc/net/getnetbynis.c
index 4725cfb..70785ac 100644
--- a/lib/libc/net/getnetbynis.c
+++ b/lib/libc/net/getnetbynis.c
@@ -99,6 +99,9 @@ _getnetbynis(const char *name, char *map, int af, struct netent *ne,
cp++;
ne->n_net = inet_network(cp);
+#if __LONG_BIT == 64
+ ne->__n_pad0 = 0; /* ABI compatibility */
+#endif
ne->n_addrtype = AF_INET;
q = ne->n_aliases = ned->net_aliases;
@@ -149,22 +152,22 @@ _nis_getnetbyname(void *rval, void *cb_data, va_list ap)
}
-int
+int
_nis_getnetbyaddr(void *rval, void *cb_data, va_list ap)
{
#ifdef YP
- unsigned long addr;
+ uint32_t addr;
int af;
struct netent *ne;
struct netent_data *ned;
char *str, *cp;
- unsigned long net2;
+ uint32_t net2;
int nn;
unsigned int netbr[4];
char buf[MAXDNAME];
int error;
- addr = va_arg(ap, unsigned long);
+ addr = va_arg(ap, uint32_t);
af = va_arg(ap, int);
ne = va_arg(ap, struct netent *);
ned = va_arg(ap, struct netent_data *);
OpenPOWER on IntegriCloud