]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix NIS and NIS+ getnetbyaddr backends.
authorUlrich Drepper <drepper@redhat.com>
Wed, 1 Jul 2009 10:41:30 +0000 (03:41 -0700)
committerUlrich Drepper <drepper@redhat.com>
Wed, 1 Jul 2009 10:41:30 +0000 (03:41 -0700)
The addresses were interpreted as class-based network addresses.

ChangeLog
nis/nss_nis/nis-network.c
nis/nss_nisplus/nisplus-network.c

index 6dfd7006371d5b723ca8a87c416a9105642ae44a..0c6c36f472f610aee07796f8ddbd1274527e49c5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 9b02302e0b521d0ec84264ce166255d14e9ba7ea..22a898bb2115a44c1ea58eff9410cd1f2799bb92 100644 (file)
@@ -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);
 
index 1cf652f071c746721d6b054c06ff482eb301dc7a..902826b62a2f68b0b7793ce0a86dddf361ffe0fa 100644 (file)
@@ -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);