summaryrefslogtreecommitdiffstats
path: root/lib/libc/net
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Increase the size of local storage to cope with the new IF_NAMESIZEi ↵Luiz Souza2017-10-081-1/+1
| | | | | | value." This reverts commit d8b2e046db23fd736b231db4860cec01250fc580.
* Increase the size of local storage to cope with the new IF_NAMESIZEi value.Luiz Souza2017-10-071-1/+1
| | | | (cherry picked from commit 6166be6c2a909d29cf13a266c2a1576a1163deb5)
* MFC r318816:trasz2017-06-062-2/+2
| | | | | | Don't end up manpage titles with a full stop. Approved by: re (marius)
* MFC r315162:pfg2017-04-071-1/+1
| | | | | | | | libc: provide some bounds-checking through reallocarray(3). reallocarray(3) is a non portable extension that originated in OpenBSD. Given that it is already in FreeBSD's libc it is useful for the cases where reallocation involves a multiplication.
* MFC r313748, r313749:markj2017-03-101-15/+15
| | | | Register nss_atexit() before parsing nsswitch.conf for the first time.
* MFC r310984,r311102:ngie2017-01-091-8/+4
| | | | | | | | | | r310984: Use calloc instead of malloc + memset(.., 0, ..) r311102 (by pfg): Cleanup inelegant calloc(3) introduced in r310984.
* MFC r309683:tuexen2016-12-181-1/+1
| | | | | Fix a bug in sctp_sendmsgx(), where the sid provided by the user was hot honored.
* Merge rr309688: address regressions in SA-16:37.libc.glebius2016-12-071-6/+5
| | | | | PR: 215105 Submitted by: <jtd2004a sbcglobal.net>
* Merge r309639 from head:glebius2016-12-061-17/+34
| | | | | | | | | | | Fix possible buffer overflow(s) in link_ntoa(3). A specially crafted sockaddr_dl argument can trigger a static buffer overflow in the libc library, with possibility to rewrite with arbitrary data following static buffers that belong to other library functions. Reviewed by: kib Security: FreeBSD-SA-16:37.libc
* MFC r305144ache2016-09-052-2/+2
| | | | | | | | 'addrlen' does not matter when we need to find the first non-zero bit in the byte from the left and 'addrlen' already counted in 'lim'. PR: 212121 Submitted by: Herbie.Robinson@stratus.com
* MFC r305133ache2016-09-031-0/+19
| | | | | Apply the same qsort() usage fix as in r304911 getaddrinfo.c qsort() can't be stabilized with just return(-1) alone.
* MFC r304911ache2016-08-301-0/+19
| | | | | | | | | | | | | The formal behavior of qsort is unstable with regard to objects that are equal. Unfortunately, RFC 3484 requires that otherwise equal objects remain in the order supplied by the DNS server. The present code attempts to deal with this by returning -1 for objects that are equal (i.e., returns that the first parameter is less then the second parameter). Unfortunately, the qsort API does not state that the first parameter passed in is in any particular position in the list. PR: 212122 Submitted by: Herbie.Robinson@stratus.com
* MFC r304034:ngie2016-08-281-3/+5
| | | | | | | | | | | Initialize `ai` to NULL and test for `ai` with type-appropriate values Depending on the address family and ai_flags containing AI_V4MAPPED, it might not do a proper DNS lookup on the provided DNS address Convert some `ai` boolean true/false checks to NULL/non-NULL while here. PR: 211790
* Revert r301707ngie2016-06-081-2/+2
| | | | | | | | | getnetent_p doesn't return NULL like getnetent does. coccinelle got confused and I didn't verify that it worked before committing the change MFC after: 1 week X-MFC with: r301707 Pointyhat to: ngie
* Use NULL instead of `0` in _ht_getnetbyname(..)ngie2016-06-081-2/+2
| | | | | | | | - getnetent returns NULL on completion/error. - .h_aliases is NULL terminated. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
* Don't call free_addrselectpolicy(&policyhead) before policyhead has beentruckman2016-05-161-1/+0
| | | | | | | initialized. Reported by: Coverity CID: 1018727
* Rename dprintf into dbg_printf to avoid collision with dprintf(3)bapt2016-05-101-10/+10
| | | | | When dprintf(3) in 2009 was added a _WITH_DPRINTF guard has also been added. This rename is made in preparation for the removal of this guard
* libc: spelling fixes.pfg2016-04-306-7/+7
| | | | Mostly on comments.
* Minor indentation issue.pfg2016-04-201-2/+1
|
* libc: use our roundup2/rounddown2() macros when param.h is available.pfg2016-04-202-5/+5
| | | | | rounddown2 tends to produce longer lines than the original code but still it makes the code more readable.
* libc: do not include <sys/types.h> where <sys/param.h> was already includedavos2016-04-1812-13/+1
| | | | | | 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).
* libc: make some more use of the nitems() macro.pfg2016-04-162-5/+5
| | | | | | | | 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.
* libc: cleanup unnecessary semicolons.pfg2016-04-111-7/+7
| | | | Found with devel/coccinelle.
* libc: replace 0 with NULL for pointers.pfg2016-04-104-5/+6
| | | | | | | | | 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)
* Implement (ACFLAGS|CFLAGS|CXXFLAGS).SRC globally.bdrewery2016-03-261-1/+0
| | | | Sponsored by: EMC / Isilon Storage Division
* sendmsg(3) -> sendmsg(2)trasz2016-02-292-2/+2
| | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* Replace nslexer.l->nslexer.c custom rule with a -D CFLAG.bdrewery2016-01-271-8/+3
| | | | | | | | | | | This avoids reproducing the lex logic which had dependencies set wrong and used an intermediate file for modifying the YY_BUF_SIZE. This has only been possible since flex 2.5.37 was imported in r250873, which uses #ifndef YY_BUF_SIZE. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
* nslexer.c does not depend on nsparser.h.bdrewery2016-01-271-1/+1
| | | | | | | | | | nslexer.o depends on nsparser.h, which is already added by bsd.lib.mk and .depend. This reverts r237402. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
* sctp_sendx() needs to provide the assoc_id back.tuexen2016-01-241-2/+7
| | | | MFC after: 3 days
* sctp_sendv() needs to fill in the association id on return.tuexen2016-01-241-0/+7
| | | | MFC after: 3 days
* Remove _gethostbynisname() and _gethostbynisaddr(). These functionsume2015-12-252-57/+0
| | | | | | used to be called from getipnodebyname(). MFC after: 1 week
* We don't need to use a temporary buffer, here.ume2015-12-221-7/+3
| | | | MFC after: 1 week
* Use _map_v4v6_address().ume2015-12-211-4/+3
| | | | MFC after: 1 week
* Simplify _map_v4v6_address().ume2015-12-211-7/+3
| | | | | Suggested by: hrs MFC after: 1 week
* If we end up following a CNAME chain that does not findume2015-12-211-1/+6
| | | | | | | | any data return that instead of internal error. PR: 156684 Obtained from: NetBSD MFC after: 1 week
* libc: Use namespace.h in a few more files.jilles2015-12-201-5/+7
| | | | | libc now no longer calls fstat(), socketpair() and wait(), only the underscore-prefixed versions (_waitpid() instead of wait()).
* addrinfo.ai_family is an address family, not a protocol family.ume2015-12-201-8/+8
| | | | | PR: 162434 MFC after: 1 week
* Use _map_v4v6_address().ume2015-12-181-4/+3
| | | | | Suggested by: hrs MFC after: 1 week
* Add AI_V4MAPPED and AI_ALL support for getaddrinfo(3).ume2015-12-182-28/+174
| | | | | PR: 198092 MFC after: 1 week
* RFC 3493 requires ignoring the loopback address for A_ADDRCONFIG.ume2015-12-121-1/+1
| | | | | | | | | Since it breaks certain jail setup, we ignore just 127.0.0.1 instead of whole loopback address range. PR: 192014 Reviewed by: hrs MFC after: 1 week
* The calls to RES_SET_H_ERRNO() macro on error paths wind upume2015-12-101-1/+2
| | | | | | | | dereferencing an uninitialized res. PR: 202142 Submitted by: Sean Boudreau MFC after: 1 week
* sdl->sdl_len in sockaddr_dl can be longer thanhrs2015-11-031-3/+13
| | | | sizeof(struct sockaddr_dl).
* - address grammarjgh2015-10-051-7/+6
| | | | | | | | PR: 203440 (based on) Submitted by: ceratv@rpi.edu Approved by: wblock@ (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D3813
* - Move PF_LOCAL at the end of the array. PF_INET{,6} is used more often.hrs2015-10-031-7/+9
| | | | | | | - Add SOCKTYPE_ANY to PF_LOCAL. - Apply AI_CANONNAME to only AF_INET{,6}. It is not meaningful for the other AFs.
* Use ANSI C prototypes. Eliminates -Wold-style-definition warnings.rodrigc2015-09-201-45/+16
|
* Use ANSI C prototypes. Eliminates -Wold-style-definition warnings.rodrigc2015-09-209-49/+20
|
* Add declarations to netdb_private.h to eliminate -Wmissing-prototypes warnings.rodrigc2015-09-205-20/+20
|
* Add declarations to eliminate -Wmissing-prototypes warningsrodrigc2015-09-201-0/+10
|
* Define _NS_PRIVATE to make declarations visible.rodrigc2015-09-201-0/+1
| | | | This eliminates -Wmissing-prototypes warnings.
* Add missing includes to eliminate -Wmissing-prototypes warningsrodrigc2015-09-202-0/+3
|
OpenPOWER on IntegriCloud