summaryrefslogtreecommitdiffstats
path: root/lib/libc/net
Commit message (Collapse)AuthorAgeFilesLines
...
* Add PF_LOCAL support in getaddrinfo(3) and getnameinfo(3):hrs2015-09-204-78/+205
| | | | | | | | | | | | | - In a PF_LOCAL address, "hostname" must begins with '/' and "servname" is always NULL. All of ai_flags are ignored. - PF_UNSPEC matches PF_LOCAL. EAI_SERVICE is not returned to make AF-independent programming easier; "servname" is always ignored in PF_LOCAL. In practice, PF_INET* and PF_LOCAL are mutually-exclusive because a hostname which begins with '/' is invalid in PF_INET*. No domain name resolution is performed for a PF_LOCAL address. Differential Revision: https://reviews.freebsd.org/D3634
* libc: Consistently call _ioctl() internally, not ioctl().jilles2015-09-191-1/+3
|
* Zero out a local variable also when PURIFY is not defined.tuexen2015-09-101-2/+0
| | | | | | | | | | | | This silence a warning brought up by valgrind whenever if_nametoindex is used. This was already discussed in PR 166483, but the code committed in r234329 guards the initilization with #ifdef PURIFY. Therefore, valgrind still complains. Since this code is not performance critical, always zero out the local variable to silence valgrind. PR: 166483 Discussed with: eadler@ MFC after: 4 weeks
* - Fix SIGSEGV when sa == NULL. NULL check in getnameinfo_inet()hrs2015-09-091-12/+8
| | | | | | | | did not work as expected. - Simplify afdl table lookup. MFC after: 3 days
* - snprintf() returns at most size-1 of the chars printed intohrs2015-09-021-10/+6
| | | | | | | | the buffer. (n == hostlen) also means the buffer length was too short. - Use sdl->sdl_data only when (sdl->sdl_nlen > 0 && sdl->sdl_alen == 0) to prevent redundant output.
* Print sdl->sdl_data when sdl->sdl_nlen > 0 as link_ntoa(3) does.hrs2015-09-011-6/+18
| | | | MFC after: 1 week
* Switch libc from using _sig{procmask,action,suspend} symbols, whichkib2015-08-291-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | are aliases for the syscall stubs and are plt-interposed, to the libc-private aliases of internally interposed sigprocmask() etc. Since e.g. _sigaction is not interposed by libthr, calling signal() removes thr_sighandler() from the handler slot etc. The result was breaking signal semantic and rtld locking. The added __libc_sigprocmask and other symbols are hidden, they are not exported and cannot be called through PLT. The setjmp/longjmp functions for x86 were changed to use direct calls, and since PIC_PROLOGUE only needed for functional PLT indirection on i386, it is removed as well. The PowerPC bug of calling the syscall directly in the setjmp/longjmp implementation is kept as is. Reported by: Pete French <petefrench@ingresso.co.uk> Tested by: Michiel Boland <boland37@xs4all.nl> Reviewed by: jilles (previous version) Sponsored by: The FreeBSD Foundation MFC after: 1 week
* - ANSIfydelphij2015-08-181-10/+5
| | | | | | | | | | | - Remove the redundant _PATH_RSH definition (paths.h at r96194); - Use pid_t for PIDs - Note that we are at the same level of OpenBSD's counterpart of revision 1.7 (r94757). No functional changes. MFC after: 2 weeks
* Fix name of a constant.tuexen2015-06-141-2/+2
| | | | MFC after: 3 days
* recv(),send(): Directly call interposing entry instead of going through PLT.jilles2015-05-102-2/+10
| | | | | | recv() and send()'s calls to recvfrom() and sendto() are much like waitpid()'s call to wait4(), and likewise need not allow PLT interposing on the called function.
* A complete user message is signalled with the MSG_EOR flag, not the MSG_EOFtuexen2015-04-231-3/+3
| | | | | | | flag. Thanks to Valentin Nechayev for reporting the issue. MFC after: 1 week
* Stop including if_var.h from userland.glebius2015-04-062-2/+0
| | | | Sponsored by: Nginx, Inc.
* Add an SCTP symbol which was missed intuexen2015-03-281-0/+1
| | | | | | | | | https://svnweb.freebsd.org/base?view=revision&revision=169622 This fixes https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=197783 Thanks to Jukka Ukkonen for reporting the bug and providing a fix. MFC after: 3 days
* Add a SCTP socket option to limit the cwnd for each path.tuexen2015-03-101-0/+3
| | | | MFC after: 1 month
* eui64_line(): plug memory leak.pfg2015-02-271-0/+1
| | | | | | CID: 978412 Reviewed by: brooks, delphij CodeReview: https://reviews.freebsd.org/D1976
* Hint out check for unsigned negative values.pfg2015-02-271-1/+1
| | | | | | | | | | | | | | | On FreeBSD socklen_t is unsigned so the check negative len in inet6_opt_append() is redundant and likely to be optimized away by the compiler. On other operating systems this is not necessarily so, and in the future we may want to sign it so leave the check in but place it in a secondary position as a subtle indication that the bogus check is intentional. Discussed with: rpaulo CID: 1017783
* Various mdoc fixes and a few EOL whitespace removals.brueffer2014-12-213-5/+5
| | | | Found with: mandoc -Tlint
* Initilize the msg_flags field consistently in all code paths.tuexen2014-12-171-1/+4
| | | | | Reported by: Coverity CID: 1018726
* Fix a typo reported by Lennart Grahl.tuexen2014-12-101-1/+1
| | | | MFC after: 3 days
* ANSIfy b64_ptonemaste2014-11-271-4/+1
|
* Fix b64_pton output buffer overrun test for exact-sized bufferemaste2014-11-251-7/+15
| | | | | | | | | | | | b64_pton would sometimes erroneously fail to decode a base64 string into a precisely sized buffer. The overflow check was a little too greedy. Reported by: Ted Unangst on freebsd-hackers@ Reviewed by: loos, trasz Obtained from: OpenBSD MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1218
* Fix ifa_data description.pluknet2014-11-251-12/+10
| | | | | | | PR: 176583 Discussed with: glebius MFC after: 1 week Sponsored by: Nginx, Inc.
* The fallback flag in nsdispatch prevents the fallback implementation ofdes2014-11-251-9/+16
| | | | | | | | | | | | | | getgroupmembership() from invoking the correct backend in the compat case. Replace it with a nesting depth counter so it only blocks one level (the first is the group -> group_compat translation, the second is the actual backend). This is one of two bugs that break getgrouplist() in the compat case, the second being that the backend's own getgroupmembership() method is ignored. Unfortunately, that is not easily fixable without a redesign of our nss implementation (which is also needed to implement the +@group syntax in /etc/passwd). PR: 190055 MFC after: 1 week
* Renove faith(4) and faithd(8) from base. It looks like industrymelifaro2014-11-092-53/+0
| | | | | | | | | have chosen different (and more traditional) stateless/statuful NAT64 as translation mechanism. Last non-trivial commits to both faith(4) and faithd(8) happened more than 12 years ago, so I assume it is time to drop RFC3142 in FreeBSD. No objections from: net@
* Eliminate conf_lock and instead rely on the NSS write lock to protectmarkj2014-10-241-8/+5
| | | | | | | | | | | | | | | NSS configuration state. As a side effect, this fixes a race condition which can occur if multiple threads call nsdispatch(3) concurrently before nsswitch.conf has been parsed. Previously, the thread holding conf_lock could cause other threads to return from nss_configure() before nsswitch.conf had been parsed, forcing them to fall back to the default sources for their NSS methods. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D994 MFC after: 1 month Sponsored by: EMC / Isilon Storage Division
* Add support for the SCTP_PR_STREAM_STATUS and SCTP_PR_ASSOC_STATUStuexen2014-08-131-0/+6
| | | | | | | | | socket options. This includes managing the correspoing stat counters. Add the SCTP_DETAILED_STR_STATS kernel option to control per policy counters on every stream. The default is off and only an aggregated counter is available. This is sufficient for the RTCWeb usecase. MFC after: 1 week
* Add support for the SCTP_AUTH_SUPPORTED and SCTP_ASCONF_SUPPORTEDtuexen2014-08-121-0/+7
| | | | | | socket options. Add also a sysctl to control the support of ASCONF. MFC after: 1 week
* Const-ify character stringpfg2014-08-071-1/+1
| | | | | Obtained from: Apple Inc. (Libc 997.90.3) MFC after: 3 days
* Add support for the SCTP_RECONFIG_SUPPORTED and the correspondingtuexen2014-08-041-0/+3
| | | | | | sysctl controlling the negotiation of the RE-CONFIG extension. MFC after: 3 days
* Add support for the SCTP_PKTDROP_SUPPORTED socket option andtuexen2014-08-031-0/+3
| | | | | | | the corresponding sysctl variable. The default is off, since the specification is not an RFC yet. MFC after: 1 week
* Add SCTP socket option SCTP_NRSACK_SUPPORTED to control thetuexen2014-08-031-0/+3
| | | | | | | | NRSACK extension. The default will still be off, since it it not an RFC (yet). Changing the sysctl name will be in a separate commit. MFC after: 1 week
* Add support for the SCTP_PR_SUPPORTED socket option as specified intuexen2014-08-021-0/+3
| | | | | | | http://tools.ietf.org/html/draft-ietf-tsvwg-sctp-prpolicies Add also a sysctl controlling the default of the end-points. MFC after: 1 week
* Cleanup the ECN configuration handling and provide an SCTP sockettuexen2014-08-021-0/+3
| | | | | | | option for controlling ECN on future associations and get the status on current associations. A simialar pattern will be used for controlling SCTP extensions in upcoming commits.
* Clean r268867.pfg2014-07-191-1/+1
| | | | Proposed by: bde
* Use unsigned optlen in getsourcefilter()pfg2014-07-191-1/+2
| | | | | | | | Sizes can not be negative and the functions that use it expect an unsigned value anyways. Obtained from: Apple (Libc-997.90.3) MFC after: 1 week
* Make generation of nslexer.c more robust.jmmv2014-07-141-3/+5
| | | | | | | | | | | | | | | | | | Ensure that lex errors fail the build instead of being silently ignored due to the piped call. Also postpone the update of the nslexer.c file until we are sure we have generated it properly. These changes fix some very obscure build failures I encountered while building FreeBSD within a chroot that did not have devfs mounted. The specific errors looked like: .../libc.so.7: undefined reference to `_nsyyerror' .../libc.so.7: undefined reference to `_nsyyin' .../libc.so.7: undefined reference to `_nsyylex' .../libc.so.7: undefined reference to `_nsyylineno' .../libc.so.7: undefined reference to `_nsyytext' and were caused due to a mangled nslexer.c being linked into libc.
* Fix build with WITHOUT_INET6.ume2014-06-261-0/+2
| | | | | Spotted by: bf MFC after: 1 week
* - Exclude loopback address rather than loopback interface.ume2014-06-261-13/+27
| | | | | | | | | | | - style(9) TODO: When AI_ADDRCONFIG is specified, getaddrinfo() can be quite slow for system with many interfaces. We should have some kernel sysctls to report IPv4/IPv6 status. Spotted by: melifaro MFC after: 1 week
* Exclude IPv4 address from doing longest match.ume2014-06-231-1/+2
| | | | | | It prevented DNS based load balancing. MFC after: 1 week
* use .Mt to mark up email addresses consistently (part4)bapt2014-06-232-4/+2
| | | | | PR: 191174 Submitted by: Franco Fichtner <franco at lastsummer.de>
* Use SOCK_CLOEXEC.ume2014-06-191-1/+1
| | | | MFC after: 1 week
* Retooling addrconfig() to exclude addresses on loopback interfacesume2014-06-181-29/+62
| | | | | | | | | | | | | when looking for configured addresses. This change is based upon the code from the submitter, and made following changes: - Exclude addresses assigned on interfaces which are down, like NetBSD does. - Exclude addresses assigned on interfaces which are ifdisabled. PR: 190824 Submitted by: Justin McOmie MFC after: 1 week
* Add support for UDP-Lite protocol (RFC 3828) to IPv4 and IPv6 stacks.kevlo2014-04-071-0/+5
| | | | | | | | Tested with vlc and a test suite [1]. [1] http://www.erg.abdn.ac.uk/~gerrit/udp-lite/files/udplite_linux.tar.gz Reviewed by: jhb, glebius, adrian
* Accept RFC 2292 option values so that RFC 2292 compliant programs thatmarcel2014-04-051-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | are unaware of RFC 3542 can construct control messages. The kernel disallows mixing RFC 2292 behaviour with RFC 3542 behaviour. Only sockets that have specifically been marked as using the RFC 2292 API can use RFC 2292 specific options. This is all good and well, but libc itself seems inconsistent with this. The root cause of this inconsistency seems to relate to the definitions of IPV6_HOPOPTS and IPV6_DSTOPTS. They are defined in RFC 2292 and re-used in RFC 3542, yet have distinct values in the kernel. It's for this reason that the kernel also has definitions for IPV6_2292HOPOPTS and IPV6_2292DSTOPTS. Not so in libc. For example: some program calls inet6_option_init() (defined by RFC 2292) with the RFC 2292 defined IPV6_HOPOPTS and IPV6_DSTOPTS. Before RFC 3542, this was translated to values of 22 and 23 (resp.) The libc implementation correctly checks that only options IPV6_HOPOPTS and IPV6_DSTOPTS are given (as per RFC 2292) but since these defines have taken on the values defined by RFC 3542 (values 49 and 50 resp,) rejects the correct option values (22 and 23) passed said program and returns -1. The precisie fix is to have inet6_option_init() and friends only accept the RFC 2292 defined IPV6_HOPOPTS & IPV6_DSTOPTS, but that breaks other code (like mld6query(8)), which seem to not be aware of RFC 3542 and how it hi-jacked the option names. So the best fix is to accept the options from both. Obtained from: Juniper Networks, Inc. MFC after: 1 week
* Make ether_line really report an error when all input is invalid.jmmv2014-03-121-5/+7
| | | | | | | | | | | | The previous code failed to return an error condition when the whole input was invalid due to improper handling of the sscanf return value. Actually, this failure was properly being caught by a test in tools/regression/lib/libc/net/test-ether.t but was not noticed because these tests are never run. (On my way to fixing that ;-) The fix applied here resembles the implementation of ether_line in NetBSD modulo the setting of an errno value (which is not documented as an expectation in the manpage anyway).
* Replace use of ${.CURDIR} by ${LIBC_SRCTOP} and define ${LIBC_SRCTOP}marcel2014-03-041-3/+3
| | | | | | | | | | | 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.
* libc/net: fix a portability issueeadler2014-02-051-1/+1
| | | | | | | * POSIX does not require socklen_t to be unsigned Submitted by: bde MFC After: 1 week (with r261454)
* libc/net: Fix some issues in inet6_opt_init() (from RFC 3542):eadler2014-02-041-4/+1
| | | | | | | | | | | | | | * The RFC says (in section 10.1) that only when extbuf is not NULL, extlen shall be checked, so don't perform this check when NULL is passed. * socklen_t is unsigned, so checking extlen for less than zero is not needed. Submitted by: swildner@dragonflybsd.org Reviewed by: Mark Martinec <Mark.Martinec+freebsd@ijs.si> Reviewed by: hrs Obtained by: DragonFlyBSD
* Fix several bugs in sctp_bindx():tuexen2014-01-041-9/+18
| | | | | | | | | | | * Set errno to EAFNOSUPPORT if an address is provided which is neither AF_INET nor AF_INET6. * Don't modify the arguments. * Don't smash the stack when provided with a non-zero port. * Handle the case correctly where the first address provided is an IPv6 address. MFC after: 3 days
* Remove an unused variable and fix a memory leak in sctp_connectx().tuexen2013-09-191-3/+4
| | | | | Approved by: re (gjb) MFC after: 3 days
OpenPOWER on IntegriCloud