This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch, master, updated. glibc-2.10-131-g2fd0cd8


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  2fd0cd8b5257e7ae0c0df0651ee62a6ef7c37cc2 (commit)
      from  5cd1f906c34256abdccc92052fbbde51fd70a565 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2fd0cd8b5257e7ae0c0df0651ee62a6ef7c37cc2

commit 2fd0cd8b5257e7ae0c0df0651ee62a6ef7c37cc2
Author: Ulrich Drepper <drepper@redhat.com>
Date:   Wed Jul 1 03:41:30 2009 -0700

    Fix NIS and NIS+ getnetbyaddr backends.
    
    The addresses were interpreted as class-based network addresses.

diff --git a/ChangeLog b/ChangeLog
index 6dfd700..0c6c36f 100644
--- 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
diff --git a/nis/nss_nis/nis-network.c b/nis/nss_nis/nis-network.c
index 9b02302..22a898b 100644
--- a/nis/nss_nis/nis-network.c
+++ b/nis/nss_nis/nis-network.c
@@ -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);
 
diff --git a/nis/nss_nisplus/nisplus-network.c b/nis/nss_nisplus/nisplus-network.c
index 1cf652f..902826b 100644
--- a/nis/nss_nisplus/nisplus-network.c
+++ b/nis/nss_nisplus/nisplus-network.c
@@ -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);
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                         |    5 +++++
 nis/nss_nis/nis-network.c         |    2 +-
 nis/nss_nisplus/nisplus-network.c |    2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]