| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
In ns_name_ntop, the NS_CMPRSFLGS check is no longer needed because
labellen (called earlier) already rejects everything which is not
a plain label (compression references and extended label types).
|
| |
|
|
|
|
|
|
| |
RES_AAONLY, RES_PRIMARY, RES_NOCHECKNAME, RES_KEEPTSIG result
in compile-time warnings. Some of these flags are still used in
applications.
|
| |
|
|
|
|
|
| |
__inet6_scopeid_pton implements strict validation of numeric scope IDs.
Use it in getaddrinfo and __res_vinit.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
The number of currently defined nameservers is stored in ->nscount,
whereas ->_u._ext.nscount is set by __libc_res_nsend only after local
initializations.
|
|
|
|
|
|
| |
Since commit e66e7419a6f58200eec6941b14e2dcff9875cc6c (Actually make
it possible to user the default name server.), the default is
INADDR_LOOPBACK, not INADDR_ANY.
|
|
|
|
|
|
|
|
|
|
| |
Resetting defdname (default domain name) before use in __res_vinit
ensures that the default domain name is correctly set to a default
value when it is not set by the LOCALDOMAIN environment variable or
the "domain" or "search" parameters in resolv.conf
Tested using the steps from:
https://sourceware.org/bugzilla/show_bug.cgi?id=19369
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch converts a few more function definitions in glibc from
old-style K&R to prototype style. This is sufficient to build and
test on x86_64 and x86 with -Wold-style-definition (I'll test on some
more architectures before proposing the actual addition of
-Wold-style-definition).
Tested for x86_64 and x86 with -Wold-style-definition in use
(testsuite - this patch affects files containing assertions).
* io/fts.c (fts_open): Convert to prototype-style function
definition.
* malloc/mcheck.c (mcheck): Likewise.
(mcheck_pedantic): Likewise.
* posix/regexec.c (re_search_2_stub): Likewise. Use
internal_function.
(re_search_internal): Likewise.
* resolv/res_init.c [RESOLVSORT] (net_mask): Convert to
prototype-style function definition.
* sunrpc/clnt_udp.c (clntudp_call): Likewise.
* sunrpc/pmap_rmt.c (clnt_broadcast): Likewise.
* sunrpc/rpcsvc/rusers.x (xdr_utmp): Likewise.
(xdr_utmpptr): Likewise.
(xdr_utmparr): Likewise.
(xdr_utmpidle): Likewise.
(xdr_utmpidleptr): Likewise.
(xdr_utmpidlearr): Likewise.
|
|
|
|
|
|
|
| |
Remove use of ext.nsmap member of struct __res_state and always use
an identity mapping betwen the nsaddr_list array and the ext.nsaddrs
array. The fact that a nameserver has an IPv6 address is signalled by
setting nsaddr_list[].sin_family to zero.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The rotate option doesn't work correctly, and only send the query to the
same server (the second in the list). The rotation code in itself is not
broken, but the nsaddrs structure is reinitialized each time at the
beginning of __libc_res_nsend unless RES_STAYOPEN is enabled.
This is due to a call to __res_iclose from the end of __libc_res_nsend
when answers from the name server have been received. This function
closes all the sockets, but doesn't free the addresses (it can do that,
but in that case the second argument is false).
This patch change the code of __res_iclose to clear statp->_u._ext.nsinit
only when the addresses are actually freed.
* resolv/res_init.c (__res_iclose): Only clear nsinit if the
addresses have been freed.
|
|
|
|
|
|
|
|
|
| |
The current comments concerning nserv and nservall are not really clear
and lead to confusion when reviewing an already complex code. Improve
them, there real meaning have been confirmed by a code analysis.
* resolv/res_init.c (__res_vinit): Improve comments about nserv
and nservall.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Parts of the resolver brought in by pthreads (at least) use inet_*
functions that aren't in the 1995/6 edition of POSIX that introduced
pthreads (or in one case, use __inet_aton which is then defined in the
same file as non-weak inet_addr). This patch fixes this by making the
affected functions into weak alias for __inet_* and using those names
in the problematic resolver code.
Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by the patch).
[BZ #17722]
* inet/inet_mkadr.c (inet_makeaddr): Rename to __inet_makeaddr and
define as weak alias of __inet_makeaddr.
* resolv/inet_addr.c (inet_addr): Rename to __inet_addr and define
as weak alias of __inet_addr.
* resolv/inet_pton.c (inet_pton): Rename to __inet_pton and define
as weak alias of __inet_pton. Use libc_hidden_weak.
* include/arpa/inet.h (__inet_pton): Declare. Use
libc_hidden_proto.
(inet_makeaddr): Don't use libc_hidden_proto.
(__inet_makeaddr): Declare. Use libc_hidden_proto.
* resolv/res_init.c (__res_vinit): Use __inet_pton instead of
inet_pton. Use __inet_makeaddr instead of inet_makeaddr.
* conform/Makefile (test-xfail-POSIX/pthread.h/linknamespace):
Remove variable.
(test-xfail-POSIX/sched.h/linknamespace): Likewise.
(test-xfail-POSIX/time.h/linknamespace): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Resolver code, brought in by pthreads (at least), uses if_* interfaces
that weren't in POSIX before 2001, resulting in linknamespace
failures. This patch changes those interfaces to be weak aliases of
__if_* and makes the resolver use __if_* directly.
Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by this patch).
[BZ #17717]
* inet/if_index.c (if_nametoindex): Rename to __if_nametoindex and
define as weak alias of __if_nametoindex. Use libc_hidden_weak.
(if_indextoname): Rename to __if_indextoname and define as weak
alias of __if_indextoname. Use libc_hidden_weak.
(if_freenameindex): Rename to __if_freenameindex and define as
weak alias of __if_freenameindex.
(if_nameindex): Rename to __if_nameindex and define as weak alias
of __if_nameindex.
* sysdeps/mach/hurd/if_index.c (if_nametoindex): Rename to
__if_nametoindex and define as weak alias of __if_nametoindex.
Use libc_hidden_weak.
(if_freenameindex): Rename to __if_freenameindex and define as
weak alias of __if_freenameindex.
(if_nameindex): Rename to __if_nameindex and define as weak alias
of __if_nameindex.
(if_indextoname): Rename to __if_indextoname and define as weak
alias of __if_indextoname. Use libc_hidden_weak.
* sysdeps/unix/sysv/linux/if_index.c (if_nametoindex): Rename to
__if_nametoindex and define as weak alias of __if_nametoindex.
Use libc_hidden_weak.
(if_freenameindex): Rename to __if_freenameindex and define as
weak alias of __if_freenameindex. Use libc_hidden_weak.
(if_nameindex_netlink): Use __if_freenameindex instead of
if_freenameindex.
(if_nameindex): Rename to __if_nameindex and define as weak alias
of __if_nameindex. Use libc_hidden_weak.
(if_indextoname): Rename to __if_indextoname and define as weak
alias of __if_indextoname. Use libc_hidden_weak.
* include/net/if.h [!_ISOMAC] (__if_nametoindex): Declare and use
libc_hidden_proto.
[!_ISOMAC] (__if_freenameindex): Likewise.
* resolv/res_init.c (__res_vinit): Use __if_nametoindex instead of
if_nametoindex.
* conform/Makefile (test-xfail-XPG4/grp.h/linknamespace): Remove
variable.
(test-xfail-XPG4/pwd.h/linknamespace): Likewise.
(test-xfail-UNIX98/aio.h/linknamespace): Likewise.
(test-xfail-UNIX98/grp.h/linknamespace): Likewise.
(test-xfail-UNIX98/pthread.h/linknamespace): Likewise.
(test-xfail-UNIX98/pwd.h/linknamespace): Likewise.
(test-xfail-UNIX98/sched.h/linknamespace): Likewise.
(test-xfail-UNIX98/time.h/linknamespace): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Various POSIX functions bring in res_init.o, res_hconf.o or
mntent_r.o, which use fgets_unlocked, which is not a POSIX function.
This patch arranges for them to use __fgets_unlocked instead. (The
IS_IN (libc) conditional in rec_hconf.c is needed because that file is
also used in nscd.)
Tested for x86_64 (testsuite, and that disassembly of installed shared
libraries is unchanged by the patch except for an assertion line
number). Note that most of the linknamespace tests that failed
because of fgets_unlocked from the resolver also fail because of other
symbols brought in by the resolver, so the number of XFAILs this
removes is limited. Also note that fgets_unlocked failures for
unistd.h for XPG3/XPG4 showed up that actually unistd.h is declaring
too much for XPG3/XPG4 (bug 17665) - there is no actual need to make
getusershell.c use __fgets_unlocked (at least as regards formal
standards are concerned; maybe it should still change for
namespace-cleanness of _DEFAULT_SOURCE) because the functions there
aren't actually in any of the supported standards; the correct fix for
those failures will be to stop the *usershell* functions appearing in
unistd.h for XPG3/XPG4.
[BZ #17664]
* misc/mntent_r.c (__getmntent_r): Use __fgets_unlocked instead of
fgets_unlocked.
* resolv/res_hconf.c [IS_IN (libc)] (fgets_unlocked): Define to
__fgets_unlocked.
* resolv/res_init.c (__res_vinit): Use __fgets_unlocked instead of
fgets_unlocked.
* conform/Makefile (test-xfail-XPG4/sys/statvfs.h/linknamespace):
Remove variable.
(test-xfail-POSIX/sys/mman.h/linknamespace): Likewise.
(test-xfail-UNIX98/sys/mman.h/linknamespace): Likewise.
(test-xfail-UNIX98/sys/statvfs.h/linknamespace): Likewise.
(test-xfail-XOPEN2K/sys/mman.h/linknamespace): Likewise.
(test-xfail-XOPEN2K/sys/statvfs.h/linknamespace): Likewise.
(test-xfail-POSIX2008/sys/mman.h/linknamespace): Likewise.
(test-xfail-POSIX2008/sys/statvfs.h/linknamespace): Likewise.
(test-xfail-XOPEN2K8/sys/mman.h/linknamespace): Likewise.
(test-xfail-XOPEN2K8/sys/statvfs.h/linknamespace): Likewise.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is some more shardware/software out there which has problems
if two DNS requests are sent using the same tuple
(source addr, source port, dest addr, dest port)
This can range from firewalls to load balancers. Some of the vendors
already fixed it in response to this problem. Still, we need a way
to make glibc work with broken environments. The single-request-reopen
flag can be used or we fall back automatically to this mode.
|
|
|
|
|
|
|
| |
* resolv/res_init.c (res_setoptions): Recognize single-request option.
* resolv/res_send.c (send_dg): If we sent two requests at once and
only get one reply before timeout switch to mode where we send the
second request only after the first answer has been received.
|
| |
|
|
|
|
| |
after reading name server list.
|
|
|
|
|
|
|
|
|
| |
ESRCH return value.
(_nss_dns_gethostbyname4_r): Likewise.
* resolv/res_init.c (__res_vinit): Initialize nscount to zero.
* sysdeps/posix/getaddrinfo.c (gaih_inet): In case we use
gethostbyname4_r, we don't have a separate IPv6 status, so copy
the no_data variable.
|
|
|
|
| |
information at the correct index.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Tomas Janousek <tjanouse@redhat.com>
Ulrich Drepper <drepper@redhat.com>
[BZ #4647]
* resolv/res_send.c (send_dg): Remove socket_pf. Use ipv6_unavail
member in __res_state, only convaddr4to6 if nssocks[ns] is a PF_INET6
socket.
* resolv/resolv.h (__res_state): Add ipv6_unavail member. Make
unused member a bitmap.
* resolv/res_init.c (__res_vinit): Reset ipv6_unavail if IPv6
servers are configured.
2007-06-18 Jakub Jelinek <jakub@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
* resolv/res_mkquery.c: Define __res_nopt.
* resolv/res_query.c (__libc_res_nquery): If RES_USE_EDNS0 is set
try adding EDNS0 record.
* resolv/res_send.c (send_dg): If request failed with FORMERR and
EDNS0 record was send make sure we don't try it again.
* resolv/resolv.h: Define RES_F_EDNS0ERR and RES_USE_EDNS0.
* include/resolv.h: Declare __res_nopt.
|
|
|
|
|
| |
randomization rather than before.
* resolv/res_init.c (res_randomid): Don't call gettimeofday here.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
res_nclose. Take addition parameter which determines whether
addresses should be freed.
(res_nclose): Call __res_iclose.
(res_thread_freeres): Likewise.
* resolv/res_data.c (res_close): Call __res_iclose.
* resolv/res_libc.c (res_init): No need to separately free the
addresses.
(__res_maybe_init): Likewise.
* resolv/res_send.c: Use __res_iclose instead of res_nclose.
* resolv/Versions [GLIBC_PRIVATE]: Add __res_iclose.
* include/resolv.h: Declare __res_iclose.
Add libc_hidden_proto for __res_iclose.
* hesiod/hesiod.c (__hesiod_res_set): No need to free name server
addresses here again.
|
| |
|
| |
|
|
|
|
|
|
| |
Update.
* resolv/res_init.c (res_thread_freeres): Reset _res.options.
[BZ #434]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2004-09-13 Ulrich Drepper <drepper@redhat.com>
* misc/sys/cdefs.h: Restore old definition of __P.
* csu/munch.awk: Remove uses of __P and __PMT.
* gmon/gmon.c: Likewise.
* hesiod/hesiod.h: Likewise.
* include/stdio.h: Likewise.
* io/fts.c: Likewise.
* libio/genops.c: Likewise.
* libio/libioP.h: Likewise.
* libio/fileops.c: Likewise.
* libio/iolibio.h: Likewise.
* libio/libio.h: Likewise.
* libio/memstream.c: Likewise.
* libio/oldfileops.c: Likewise.
* libio/oldstdfiles.c: Likewise.
* libio/iopopen.c: Likewise.
* libio/vsnprintf.c: Likewise.
* libio/vswprintf.c: Likewise.
* libio/wgenops.c: Likewise.
* libio/oldiopopen.c: Likewise.
* locale/programs/xmalloc.c: Likewise.
* locale/programs/xstrdup.c: Likewise.
* malloc/mtrace.c: Likewise.
* misc/getttyent.c: Likewise.
* misc/getusershell.c: Likewise.
* nis/rpcsvc/ypupd.h: Likewise.
* posix/fnmatch.h: Likewise.
* posix/glob.h: Likewise.
* resolv/arpa/nameser.h: Likewise.
* resolv/gethnamaddr.c: Likewise.
* resolv/resolv.h: Likewise.
* resolv/inet_net_ntop.c: Likewise.
* resolv/inet_net_pton.c: Likewise.
* resolv/res_init.c: Likewise.
* resolv/nss_dns/dns-network.c: Likewise.
* stdio-common/vfprintf.c: Likewise.
* stdio-common/reg-printf.c: Likewise.
* sysdeps/generic/chflags.c: Likewise.
* sysdeps/generic/fchflags.c: Likewise.
* sysdeps/generic/glob.c: Likewise.
* sysdeps/generic/printf_fphex.c: Likewise.
* sysdeps/generic/memcmp.c: Likewise.
* sysdeps/generic/memcopy.h: Likewise.
* sysdeps/generic/morecore.c: Likewise.
* sysdeps/generic/sstk.c: Likewise.
* sysdeps/posix/sigvec.c: Likewise.
* sysdeps/posix/ttyname_r.c: Likewise.
* sysdeps/standalone/arm/bits/errno.h: Likewise.
* sysdeps/standalone/standalone.h: Likewise.
* sysdeps/standalone/i386/force_cpu386/brdinit.c: Likewise.
* sysdeps/standalone/i386/force_cpu386/_exit.c: Likewise.
* sysdeps/unix/arm/start.c: Likewise.
* sysdeps/unix/bsd/sigaction.c: Likewise.
* sysdeps/unix/bsd/sun/m68k/sigtramp.c: Likewise.
* sysdeps/unix/bsd/sun/sparc/sigtramp.c: Likewise.
* sysdeps/unix/bsd/sun/sunos4/wait4.c: Likewise.
* sysdeps/unix/bsd/ultrix4/mips/sigvec.c: Likewise.
* sysdeps/unix/bsd/ultrix4/sysconf.c: Likewise.
* sysdeps/unix/sparc/start.c: Likewise.
* sysdeps/unix/sysv/getdents.c: Likewise.
* sysdeps/unix/sysv/irix4/fpathconf.c: Likewise.
* sysdeps/unix/sysv/irix4/getgroups.c: Likewise.
* sysdeps/unix/sysv/irix4/getpriority.c: Likewise.
* sysdeps/unix/sysv/irix4/getrusage.c: Likewise.
* sysdeps/unix/sysv/irix4/pathconf.c: Likewise.
* sysdeps/unix/sysv/irix4/setgroups.c: Likewise.
* sysdeps/unix/sysv/irix4/sigtramp.c: Likewise.
* sysdeps/unix/sysv/irix4/start.c: Likewise.
* sysdeps/unix/sysv/irix4/sysconf.c: Likewise.
* sysdeps/unix/sysv/sco3.2.4/__setpgid.c: Likewise.
* sysdeps/unix/sysv/sco3.2.4/getgroups.c: Likewise.
* sysdeps/unix/sysv/sysv4/__getpgid.c: Likewise.
* sysdeps/unix/sysv/sysv4/__setpgid.c: Likewise.
* sysdeps/unix/sysv/sysv4/getpgid.c: Likewise.
* sysdeps/unix/sysv/sysv4/setpgid.c: Likewise.
* sysdeps/unix/sysv/sysv4/sethostname.c: Likewise.
* sysdeps/unix/sysv/sysv4/setsid.c: Likewise.
* sysdeps/unix/sysv/sysv4/sysconf.c: Likewise.
* sysdeps/unix/sysv/sysv4/waitpid.c: Likewise.
* sysdeps/unix/sysv/sysv4/solaris2/getdents.c: Likewise.
* time/tzset.c: Likewise.
* time/strftime_l.c: Likewise.
* time/strptime_l.c: Likewise.
* crypt/md5.h: Likewise.
|
|
|
|
|
|
| |
* resolv/resolv.h (RES_DEFAULT): Add RES_NOIP6DOTINT.
* resolv/res_init.c (res_setoptions): Recognize ip6-dotint option.
Reset RES_NOIP6DOTINT flag in this case..
|
|
|
|
|
|
|
| |
2004-08-11 Andreas Schwab <schwab@suse.de>
* resolv/res_libc.c: Move definition of __res_initstamp ...
* resolv/res_init.c: ... here.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
2004-08-04 Jakub Jelinek <jakub@redhat.com>
* hesiod/hesiod.c (__hesiod_res_get): Use calloc instead of malloc +
memset.
(__hesiod_res_set): Free nsaddrs.
* include/resolv.h (__res_maybe_init): Add prototype.
* resolv/resolv.h (struct __res_state): Add _u._ext.initstamp field.
* resolv/Versions (libc): Add __res_maybe_init@@GLIBC_PRIVATE.
* resolv/res_libc.c (__res_initstamp, lock): New variables.
(res_init): Increase __res_initstamp.
(__res_maybe_init): New function.
* resolv/res_init.c (__res_vinit): Initialize _u._ext.initstamp.
* hesiod/hesiod.c (__hesiod_res_get): Use __res_maybe_init instead
of RES_INIT check and {res_ninit,__res_ninit,res_init} call.
* sysdeps/posix/getaddrinfo.c (gaih_inet): Likewise.
* resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname2_r,
_nss_dns_gethostbyaddr_r): Likewise.
* resolv/nss_dns/dns-network.c (_nss_dns_getnetbyname_r,
_nss_dns_getnetbyaddr_r): Likewise.
* resolv/gethnamaddr.c (gethostbyname, gethostbyname2,
gethostbyaddr): Likewise.
* resolv/res_data.c (fp_nquery, res_mkquery, res_mkupdate,
res_isourserver, res_sendsigned, res_update, res_search,
res_querydomain): Likewise.
* nss/getXXbyYY_r.c (INTERNAL (REENTRANT_NAME)): Likewise.
* nss/digits_dots.c (__nss_hostname_digits_dots): Likewise.
* nss/getnssent_r.c (__nss_setent, __nss_endent, __nss_getent_r):
Likewise.
* sysdeps/posix/getaddrinfo.c (gaih_inet): Set ai_family for
V4-mapped IPv6 addresses and req->ai_family==AF_INET.
Reported by A. Guru <a.guru@sympatico.ca>.
* po/pl.po: Likewise.
characters than necessary.
|