summaryrefslogtreecommitdiff
path: root/lib/libc/resolv
Commit message (Collapse)AuthorAgeFilesLines
* Rather than using the legacy IP struct fields in the union for theBjoern A. Zeeb2019-06-041-1/+1
| | | | | | | | | | | | | port number, properly access them by their IPv6 names. This will make it easier to slice up and compile out address families in the future. No functional change intended. MFC after: 6 weeks Notes: svn path=/head/; revision=348671
* Allow the use of TCP instead of UDP for queries by setting options usevcBjoern A. Zeeb2018-08-161-0/+2
| | | | | | | | | | | in resolv.conf which sets RES_USEVC. Reviewed by: ume MFC after: 17 days Differential Revision: https://reviews.freebsd.org/D16607 Notes: svn path=/head/; revision=337904
* SPDX: license IDs for some ISC-related files.Pedro F. Giffuni2017-12-0812-16/+28
| | | | Notes: svn path=/head/; revision=326695
* libc: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-252-0/+4
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326193
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-207-7/+21
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* Renumber copyright clause 4Warner Losh2017-02-287-7/+7
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Replace dot-dot relative pathing with SRCTOP-relative paths where possibleEnji Cooper2017-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | This reduces build output, need for recalculating paths, and makes it clearer which paths are relative to what areas in the source tree. The change in performance over a locally mounted UFS filesystem was negligible in my testing, but this may more positively impact other filesystems like NFS. LIBC_SRCTOP was left alone so Juniper (and other users) can continue to manipulate lib/libc/Makefile (and other Makefile.inc's under lib/libc) as include Makefiles with custom options. Discussed with: marcel, sjg MFC after: 1 week Reviewed by: emaste Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D9207 Notes: svn path=/head/; revision=312451
* Don't leak addrinfo if ai->ai_addrlen <= minsiz test fails.Don Lewis2016-06-081-12/+13
| | | | | | | | | | | | | | | | | If the ai->ai_addrlen <= minsiz test fails, then freeaddrinfo() does not get called to free the memory just allocated by getaddrinfo(). Fix by moving ai->ai_addrlen <= minsiz to a separate nested if block, and keep freeaddrinfo() in the outer block so that freeaddrinfo() will be called whenever getaddrinfo() succeeds. Reported by: Coverity CID: 1273652 Reviewed by: ume MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6756 Notes: svn path=/head/; revision=301592
* Since rdata is only used as an argument to the immediately followingDon Lewis2016-05-161-5/+3
| | | | | | | | | | | | call to res_nopt_rdata(), revert r299879 and fix CID 603941 by moving rdata = &buf[n]; inside the if block. Reported by: Coverity CID: 603941 Notes: svn path=/head/; revision=299880
* Likely a false positive ... but make sure that -1 can't be used as anDon Lewis2016-05-161-4/+6
| | | | | | | | | | | array index by splitting up a test. Reported by: Coverity CID: 603941 MFC after: 1 week Notes: svn path=/head/; revision=299879
* libc: spelling fixes.Pedro F. Giffuni2016-04-303-4/+4
| | | | | | | Mostly on comments. Notes: svn path=/head/; revision=298830
* libc: do not include <sys/types.h> where <sys/param.h> was already includedAndriy Voskoboinyk2016-04-189-9/+0
| | | | | | | | | According to style(9): > normally, include <sys/types.h> OR <sys/param.h>, but not both. (<sys/param.h> already includes <sys/types.h> when LOCORE is not defined). Notes: svn path=/head/; revision=298226
* libc: make some more use of the nitems() macro.Pedro F. Giffuni2016-04-163-3/+3
| | | | | | | | | | | We have an nitems() macro in the <sys/param.h> header that is convenient to re-use as it makes things easier to read. Given that it is available already without adding additional headers and other parts of libc already use it, extend a bit more its use. Notes: svn path=/head/; revision=298120
* libc: replace 0 with NULL for pointers.Pedro F. Giffuni2016-04-103-11/+8
| | | | | | | | | | | | While here also cleanup some surrounding code; particularly drop some malloc() casts. Found with devel/coccinelle. Reviewed by: bde (previous version - all new bugs are mine) Notes: svn path=/head/; revision=297790
* Allow users override `DEBUG` on the command line via DEBUG_FLAGS="-DDEBUG" withEnji Cooper2015-12-155-5/+15
| | | | | | | | | | | lib/libc/resolv by conditionalizing its definition MFC after: 3 days Reviewed by: ume, vangyzen Differential Revision: https://reviews.freebsd.org/D4519 Notes: svn path=/head/; revision=292250
* resolver: preserve binary compatibility; reduce header pollutionEric van Gyzen2015-12-143-20/+29
| | | | | | | | | | | | | | | | | In r289315, I added new fields to res_state. This broke binary backward compatibility. It also broke some ports (and possibly other code) by requiring the definition of time_t and struct timespec. Fix these problems by moving the new fields into __res_state_ext. Suggested by: ume Reviewed by: ume MFC after: 3 days Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D4472 Notes: svn path=/head/; revision=292216
* resolver: abuse _res a little lessEric van Gyzen2015-10-231-39/+52
| | | | | | | | | | | | | | | | | | | | In the past, _res was a global variable. Now, it's multiple function calls. Several functions in the resolver use _res multiple times and therefore call the function(s) far more than necessary. Fix those callers to store the result of _res in a local variable. Add __noinline to the definition of res_init() to avoid the code bloat that these changes would have otherwise incurred. Thanks to jilles for noticing this. Reviewed by: jilles MFC after: 1 week Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D3887 Notes: svn path=/head/; revision=289837
* resolver: automatically reload /etc/resolv.confEric van Gyzen2015-10-142-2/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | On each resolver query, use stat(2) to see if the modification time of /etc/resolv.conf has changed. If so, reload the file and reinitialize the resolver library. However, only call stat(2) if at least two seconds have passed since the last call to stat(2), since calling it on every query could kill performance. This new behavior is enabled by default. Add a "reload-period" option to disable it or change the period of the test. Document this behavior and option in resolv.conf(5). Polish the man page just enough to appease igor. https://lists.freebsd.org/pipermail/freebsd-arch/2015-October/017342.html Reviewed by: kp, wblock Discussed with: jilles, imp, alfred MFC after: 1 month Relnotes: yes Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D3867 Notes: svn path=/head/; revision=289315
* Use ANSI C prototypes. Eliminates -Wold-style-definition warnings.Craig Rodrigues2015-09-224-21/+9
| | | | Notes: svn path=/head/; revision=288114
* Add declarations to eliminate -Wmissing-prototypes warningsCraig Rodrigues2015-09-201-0/+3
| | | | Notes: svn path=/head/; revision=288018
* Add support for '_' occurring at the beginning or end of a nameHajimu UMEMOTO2015-06-101-3/+3
| | | | | | | | | | | component. PR: 176093 Submitted by: landonf__at__bikemonkey.org MFC after: 1 week Notes: svn path=/head/; revision=284229
* Update our stub resolver to final version of libbind.Hajimu UMEMOTO2014-08-1213-120/+208
|\ | | | | | | | | | | | | Obtained from: ISC Notes: svn path=/head/; revision=269867
| * We don't use these files.Hajimu UMEMOTO2014-08-102-195/+0
| | | | | | | | Notes: svn path=/vendor/resolver/dist/; revision=269781
| * Bring final version of libbind:Pedro F. Giffuni2014-08-0513-112/+382
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From http://www.isc.org/downloads/libbind/ The libbind functions have been separated from the BIND suite as of BIND 9.6.0. Originally from older versions of BIND, they have been continually maintained and improved but not installed by default with BIND 9. This standard resolver library contains the same historical functions and headers included with many Unix operating systems. In fact, most implementations are based on the same original code. At present, NetBSD maintains libbind code, now known as "netresolv". Notes: svn path=/vendor/resolver/dist/; revision=269610
| * Import the resolver part of BIND 9.4.3.vendor/resolver/9.4.3Hajimu UMEMOTO2008-12-144-24/+139
| | | | | | | | | | Notes: svn path=/vendor/resolver/dist/; revision=186083 svn path=/vendor/resolver/9.4.3/; revision=186084; tag=vendor/resolver/9.4.3
| * Vendor import of BIND 9.4.2vendor/resolver/9.4.2Hajimu UMEMOTO2007-12-032-19/+30
| | | | | | | | | | Notes: svn path=/vendor/resolver/dist/; revision=174223 svn path=/vendor/resolver/9.4.2/; revision=174225; tag=vendor/resolver/9.4.2
* | Replace use of ${.CURDIR} by ${LIBC_SRCTOP} and define ${LIBC_SRCTOP}Marcel Moolenaar2014-03-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | if not already defined. This allows building libc from outside of lib/libc using a reach-over makefile. A typical use-case is to build a standard ILP32 version and a COMPAT32 version in a single iteration by building the COMPAT32 version using a reach-over makefile. Obtained from: Juniper Networks, Inc. Notes: svn path=/head/; revision=262722
* | libc/resolv: Use poll() instead of kqueue().Jilles Tjoelker2014-01-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | The resolver in libc creates a kqueue for watching a single file descriptor. This can be done using poll() which should be lighter on the kernel and reduce possible problems with rlimits (file descriptors, kqueues). Reviewed by: jhb Notes: svn path=/head/; revision=260652
* | libc: Make resolver sockets close-on-exec (SOCK_CLOEXEC).Jilles Tjoelker2013-09-061-2/+3
| | | | | | | | | | | | | | | | Although the resolver's sockets are exposed to applications via res_state, I do not expect them to pass the sockets across execve(). Notes: svn path=/head/; revision=255336
* | libc: Make various internal file descriptors from fopen() close-on-exec.Jilles Tjoelker2013-08-232-2/+2
| | | | | | | | Notes: svn path=/head/; revision=254700
* | Remove meaningless self-assignment in res_send.c, otherwise clang willDimitry Andric2011-12-151-2/+0
| | | | | | | | | | | | | | | | | | | | | | warn about it. I guess this was originally done to silence a bogus warning by an older version of gcc, but I could not reproduce it with any version of gcc that I have access to. MFC after: 1 week Notes: svn path=/head/; revision=228537
* | Add an option to enforce strict RFC 1034 compliance.Xin LI2009-05-291-0/+4
| | | | | | | | | | | | | | PR: kern/129477 Notes: svn path=/head/; revision=193023
* | Merge the resolver part of BIND 9.4.3 into HEAD.Hajimu UMEMOTO2008-12-144-24/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | It includes the following fix: 2426. [bug] libbind: inet_net_pton() can sometimes return the wrong value if excessively large netmasks are supplied. [RT #18512] Reported by: Maksymilian Arciemowicz <cxib__at__securityreason.com> Notes: svn path=/head/; revision=186090
* | Allow underscore in domain names while resolving. While having underscoreXin LI2008-02-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | is a violation of RFC 1034 [STD 13], it is accepted by certain name servers as well as other popular operating systems' resolver library. Bugs are mine. Obtained from: ume MFC after: 2 weeks Notes: svn path=/head/; revision=176325
* | Merge BIND 9.4.2 into main chunk.Hajimu UMEMOTO2007-12-032-18/+25
| | | | | | | | Notes: svn path=/head/; revision=174226
* | Merge BIND 9.4.1 into main chunk.Hajimu UMEMOTO2007-06-0311-241/+265
| | | | | | | | | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=170244
* | This commit was generated by cvs2svn to compensate for changes in r170242,Hajimu UMEMOTO2007-06-032-0/+3
|\| | | | | | | | | | | | | which included commits to RCS files with non-trunk default branches. Notes: svn path=/head/; revision=170243
| * Vendor import of BIND 9.4.1Hajimu UMEMOTO2007-06-0313-242/+269
| | | | | | | | Notes: svn path=/vendor/resolver/dist/; revision=170242
| * Vendor import of BIND 9.3.3Hajimu UMEMOTO2006-12-153-17/+12
| | | | | | | | Notes: svn path=/vendor/resolver/dist/; revision=165254
| * Import of BIND 9.3.3rc2Hajimu UMEMOTO2006-10-241-7/+7
| | | | | | | | Notes: svn path=/vendor/resolver/dist/; revision=163659
* | Use C comments since we now preprocess these files with CPP.Daniel Eischen2007-04-291-4/+4
| | | | | | | | Notes: svn path=/head/; revision=169092
* | __p_rcode_syms is declared as external in resolv.conf, so it cannot beAlexander Kabaev2007-04-062-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | redeclared as static in res_debug.c. Make __p_rcode_syms global and add it to Symbol map. The rest of __p_??_syms are already global. Choice of FBSD_1.0 version for these debug symbols seems strange and should be revisited before symbol versioning is enabled for libc.so.7. Notes: svn path=/head/; revision=168441
* | Only reject file descriptors higher than FD_SETSIZE if we are not usingJohn Baldwin2007-03-051-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | poll(2) or kqueue(2). Previously we rejected fd's higher than FD_SETSIZE for kevent(2), and larger than sysconf(_SC_OPEN_MAX) for poll(2). However, the check for poll(2) wasn't really needed. open(2) and socket(2) won't return an fd you can't pass to either poll(2) or kevent(2). This fixes a but where gethostbyname() would fail if you had more than 1023 files open in a process. MFC after: 1 week Reviewed by: ume Found by: ps Notes: svn path=/head/; revision=167246
* | Per Regents of the University of Calfornia letter, remove advertisingWarner Losh2007-01-097-28/+0
| | | | | | | | | | | | | | | | | | clause. # If I've done so improperly on a file, please let me know. Notes: svn path=/head/; revision=165903
* | Merge BIND9 9.3.3 into main chunk.Hajimu UMEMOTO2006-12-153-17/+12
| | | | | | | | | | | | | | | | Obtained from: ISC MFC after: 1 week Notes: svn path=/head/; revision=165258
* | Merge res_send.c of BIND9 9.3.3rc2 into main chunk. It includesHajimu UMEMOTO2006-10-241-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | following fix: Retransmission timeouts should be based on which attempt it is to the nameserver and not the nameserver itself. Obtained from: ISC MFC after: 3 days Notes: svn path=/head/; revision=163661
* | Check if the filedes of kevent is expected one. Though ourHajimu UMEMOTO2006-08-041-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | old resolver opened just one socket, BIND9's resolver may open more than one sockets. And, BIND9's resolver doesn't close the socket on timeout. So, we need this check. Reported by: freebsd-cvs-src__at__oldach.net (Helge Oldach), bz Hinted by: rwatson Notes: svn path=/head/; revision=160967
* | _close() should be called instead of close() here.Hajimu UMEMOTO2006-08-041-2/+6
| | | | | | | | Notes: svn path=/head/; revision=160965
* | Nuke some compatibility crufts of resolver for 6.X and earlier.Hajimu UMEMOTO2006-05-213-15/+0
| | | | | | | | | | | | | | X-MFC after: never Notes: svn path=/head/; revision=158792
* | Upgrade res_update(3) and the friends to BIND9's one excluding TSIGHajimu UMEMOTO2006-05-215-7/+60
| | | | | | | | | | | | | | | | | | support. X-MFC after: never Notes: svn path=/head/; revision=158787