+2009-07-01 Ulrich Drepper <drepper@redhat.com>
+
+ * nss/nss_files/files-network.c (netbyaddr): If type is AF_UNSPEC,
+ recognize all types. Fix endianess in comparison of network number.
+ * nss/getent.c (networks_keys): Pass AF_UNSPEC instead of AF_UNIX
+ to getnetbyaddr.
+
2009-06-26 H.J. Lu <hongjiu.lu@intel.com>
* sysdeps/x86_64/multiarch/ifunc-defines.sym (FAMILIY_OFFSET): Define.
for (i = 0; i < number; ++i)
{
if (isdigit (key[i][0]))
- net = getnetbyaddr (inet_addr (key[i]), AF_UNIX);
+ net = getnetbyaddr (inet_addr (key[i]), AF_UNSPEC);
else
net = getnetbyname (key[i]);
/* Networks file parser in nss_files module.
- Copyright (C) 1996, 1997, 1998, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1996-1998, 2000, 2001, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
DB_LOOKUP (netbyaddr, ,,
{
- if (result->n_addrtype == type && result->n_net == net)
+ if ((type == AF_UNSPEC || result->n_addrtype == type)
+ && result->n_net == htonl (net))
/* Bingo! */
break;
}, uint32_t net, int type)