mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-22 02:40:08 +00:00
Fix NIS and NIS+ getnetbyaddr backends.
The addresses were interpreted as class-based network addresses.
This commit is contained in:
parent
5cd1f906c3
commit
2fd0cd8b52
@ -1,5 +1,10 @@
|
||||
2009-07-01 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* nis/nss_nis/nis-network.c (_nss_nis_getnetbyaddr_r): Don't use
|
||||
inet_makeaddr. This worked only with class-based networks.
|
||||
* nis/nss_nisplus/nisplus-network.c (_nss_nisplus_getnetbyaddr_r):
|
||||
Likewise.
|
||||
|
||||
* nss/nss_files/files-network.c (netbyaddr): If type is AF_UNSPEC,
|
||||
recognize all types.
|
||||
* nss/getent.c (networks_keys): Pass AF_UNSPEC instead of AF_UNIX
|
||||
|
@ -241,7 +241,7 @@ _nss_nis_getnetbyaddr_r (uint32_t addr, int type, struct netent *net,
|
||||
if (__builtin_expect (yp_get_default_domain (&domain), 0))
|
||||
return NSS_STATUS_UNAVAIL;
|
||||
|
||||
struct in_addr in = inet_makeaddr (addr, 0);
|
||||
struct in_addr in = { .s_addr = htonl (addr) };
|
||||
char *buf = inet_ntoa (in);
|
||||
size_t blen = strlen (buf);
|
||||
|
||||
|
@ -433,7 +433,7 @@ _nss_nisplus_getnetbyaddr_r (uint32_t addr, const int type,
|
||||
char buf2[18];
|
||||
int olderr = errno;
|
||||
|
||||
struct in_addr in = inet_makeaddr (addr, 0);
|
||||
struct in_addr in = { .s_addr = htonl (addr) };
|
||||
strcpy (buf2, inet_ntoa (in));
|
||||
size_t b2len = strlen (buf2);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user