From 5cd1f906c34256abdccc92052fbbde51fd70a565 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 1 Jul 2009 03:33:26 -0700 Subject: Fix getent networks lookup and resulting incorrect NSS change. I changed the files NSS backend for networks because I thought the getent use of getnetbyaddr is correct. But it isn't. Undo parts of the last change and fix getent. --- nss/getent.c | 2 +- nss/nss_files/files-network.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'nss') diff --git a/nss/getent.c b/nss/getent.c index 3a482e140f..d70a8da0f4 100644 --- a/nss/getent.c +++ b/nss/getent.c @@ -534,7 +534,7 @@ networks_keys (int number, char *key[]) for (i = 0; i < number; ++i) { if (isdigit (key[i][0])) - net = getnetbyaddr (inet_addr (key[i]), AF_UNSPEC); + net = getnetbyaddr (ntohl (inet_addr (key[i])), AF_UNSPEC); else net = getnetbyname (key[i]); diff --git a/nss/nss_files/files-network.c b/nss/nss_files/files-network.c index 064de5a143..92aea75d9e 100644 --- a/nss/nss_files/files-network.c +++ b/nss/nss_files/files-network.c @@ -82,7 +82,7 @@ DB_LOOKUP (netbyname, ,, DB_LOOKUP (netbyaddr, ,, { if ((type == AF_UNSPEC || result->n_addrtype == type) - && result->n_net == htonl (net)) + && result->n_net == net) /* Bingo! */ break; }, uint32_t net, int type) -- cgit 1.4.1