summaryrefslogtreecommitdiffstats
path: root/lib/libc/net
AgeCommit message (Collapse)AuthorFilesLines
2021-01-19Prevent an overflow in inet_net_pton(3) when the passed in buffer isflorian1-11/+18
too small in the AF_INET6 case. Spotted by Brad House (brad AT brad-house.com) with the c-ares regression test. The man page says Caution: The dst field should be zeroed before calling inet_net_pton() as the function will only fill the number of bytes necessary to encode the network number in network byte order. Which seems to suggest that the function should work if the passed in storage is big enough to hold the prefix, which might be smaller than sizeof(in6_addr). Input & OK tb
2020-07-06Add support for timeconting in userland.pirofti1-3/+3
This diff exposes parts of clock_gettime(2) and gettimeofday(2) to userland via libc eliberating processes from the need for a context switch everytime they want to count the passage of time. If a timecounter clock can be exposed to userland than it needs to set its tc_user member to a non-zero value. Tested with one or multiple counters per architecture. The timing data is shared through a pointer found in the new ELF auxiliary vector AUX_openbsd_timekeep containing timehands information that is frequently updated by the kernel. Timing differences between the last kernel update and the current time are adjusted in userland by the tc_get_timecount() function inside the MD usertc.c file. This permits a much more responsive environment, quite visible in browsers, office programs and gaming (apparently one is are able to fly in Minecraft now). Tested by robert@, sthen@, naddy@, kmos@, phessler@, and many others! OK from at least kettenis@, cheloha@, naddy@, sthen@
2020-04-25A comma is not appropriate here, use a semicolonjca1-2/+2
Suggested by Evan Silberman, confirmed by jmc@
2020-04-25Discourage use of RES_USE_INET6jca1-1/+5
Suggested by eric@, input from deraadt@, ok deraadt@ eric@
2020-04-25Fix RES_USE_INET6 descriptionjca1-7/+9
The previous wording implied this option does nothing, which is wrong. This option does affect the way gethostbyname(3) works on OpenBSD (return IPv6 addresses if available). On some systems, it also introduces IPv4-mapped IPv6 addresses, a "feature" that we don't support. ok deraadt@ eric@
2020-01-22delete wasteful ;;deraadt1-2/+2
ok tedu
2019-08-30mop up resolver.3 rename; ok deraadtjmc5-15/+15
2019-08-30mop up for inet_net rename; ok deraadtjmc3-9/+9
2019-08-30Move 4 manual pages from not-a-function filenames to a correct filename,deraadt6-16/+16
and correct Xr. ok jmc
2019-07-03snprintf/vsnprintf return < 0 on error, rather than -1.deraadt1-2/+2
2019-06-28When system calls indicate an error they return -1, not some arbitraryderaadt3-10/+10
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
2019-06-20sockatmark(3), recv(2), getsockopt(2), and connect(2) return specificallyderaadt1-4/+4
-1 to mark failure, not arbitrary values < 0. I believe manual pages should follow the described contract precisely and accurately.
2019-05-13explicitly mention that RES_NOALIASES has no effect;schwarze1-3/+4
jmc@ noticed that the text wasn't completely clear; OK jmc@
2019-02-13Xr the byteorder funcs; from tim kuijstenjmc1-3/+4
2019-01-25I am retiring my old email address; replace it with my OpenBSD one.millert1-3/+3
2019-01-14There are cases where a program doing dns requests wants to set theotto1-2/+4
Checking Disabled flag. Introduce a RES flag to do so. ok krw@ deraadt@ eric@
2018-11-09Remove ethers(5) YP support bits from libc as it makes it difficult tobrynet2-70/+8
effectively use pledge(2) in some programs. approval from many, thanks! idea by & ok deraadt@
2018-05-10Fix typo in RFC number.tb1-2/+2
ok benno
2018-04-28reference hosts(5) instead of networks(5)schwarze1-3/+3
2018-04-28Remove references to the obsolete getnetent(3) and networks(5).schwarze2-10/+7
2018-04-28Stop talking about /etc/networks, which is no longer used,schwarze1-39/+38
and reference gethostby*(3) and /etc/hosts instead. Say that setnetent(3), getnetent(3), and endnetent(3) now do nothing. With feedback from guenther and significant help from deraadt@.
2018-04-28Say that sethostent(3), gethostent(3), and endhostent(3) do nothing.schwarze1-50/+19
While here, stop implying plans to support additional address families in the future, and do not call gethostbyname2(3) "advanced". OK deraadt@ guenther@
2018-04-28To allow us to get rid of /etc/networks, make setnetent(3),schwarze1-75/+4
getnetent(3), and endnetent(3) do nothing, just like sethostent(3), gethostent(3), and endhostent(3) years ago. OK deraadt@ guenther@
2018-01-12Adjust references for sysctl(3) to sysctl(2)deraadt1-4/+4
2017-11-28Add the missing STANDARDS section (kettenis@ noticed that these areschwarze1-6/+14
POSIX functions) and turn the weird DIAGNOSTICS section into a normal RETURN VALUES section while here.
2017-07-08update the little endian processor list to give it a chance of matchingtedu2-6/+6
what the reader is using.
2017-05-03make the description strings match the codederaadt1-10/+10
2017-04-27Remove "len < 0" check; len is socklen_t (uint32_t) so can't bemillert1-2/+2
negative. Quiets a warning from clang. OK bluhm@
2017-03-06size is unsigned so using ==0 not <=0 when checking for buffer exhaustionmillert1-4/+4
2017-03-06Pull in a change from the bind 8 resolver that fixes a potentialmillert1-10/+16
crash when given a large hex number as part of the dotted quad. OK deraadt@ jsg@
2017-02-27Add support for RES_USE_DNSSECjca1-5/+2
RES_USE_DNSSEC is implemented by setting the DNSSEC DO bit in outgoing queries. The resolver is then supposed to set the AD bit in the reply if it managed to validate the answer through DNSSEC. Useful when the application doesn't implement validation internally. This scheme assumes that the validating resolver is trusted and that the communication channel between the validating resolver and and the client is secure. ok eric@ gilles@
2017-02-18Add EDNS0 support.jca1-4/+3
EDNS allows for various DNS extensions, among which UDP DNS packets size bigger than 512 bytes. The default is still to not advertize anything. ok eric@
2017-01-24in resolver(3), document that _EDNS0 and _DNSSEC are no ops;jmc1-6/+17
diff from kirill miazine while here, bump all the no op texts to one standard blurb; help/ok jca
2016-12-16Eliminate some gcc warnings about 'unused variables', mostly bykrw1-2/+2
adding appropriate #ifdef's around declarations. ok millert@ (with a tweak I will commit separately)
2016-12-15Nuke some trailing tabs.krw1-3/+3
2016-12-08Fix regressions introduce in the fix for CVE-2016-6559.millert1-6/+5
From FreeBSD (glebius)
2016-12-07Fix a typo, decrement rem, don't increment for single digit hex bytes.millert1-2/+2
From Henri Kemppainen
2016-12-06CVE-2016-6559: fix potential buffer overflow(s) in link_ntoa(3).millert1-19/+35
A specially crafted struct sockaddr_dl argument can trigger a stack overflow of a static buffer in libc. An attacker may be able to use this to write to arbitrary locations in the data segment. From FreeBSD (glebius); OK deraadt@ mestre@
2016-09-21Delete casts to off_t and size_t that are implied by assignmentsguenther4-11/+10
or prototypes. Ditto for some of the char* and void* casts too. verified no change to instructions on ILP32 (i386) and LP64 (amd64) ok natano@ abluhm@ deraadt@ millert@
2016-08-05Obvious minor fixes:schwarze2-36/+57
* Add missing .Dv, .Ev, and .Fa macros. * Delete deprecated .Tn macros. * Mark up global variable names with .Va, not with .Fa or .Li. * Mark up config file commands with .Ic, not with .Fa. * Fix HISTORY, trivial to verify from the CSRG archive CD.
2016-08-05Make RES_OPTIONS point directly to resolv.conf(5) instead of going throughmartijn1-3/+3
resolver(3). OK jmc@
2016-05-29Prefer AF_* over PF_* and 'address family' over 'protocol family'guenther1-9/+9
ok jung@
2016-05-28rcmd(3) and rcmdsh(3) use getaddrinfo(3) not gethostbyname(3).millert2-9/+9
2016-05-28Use getaddrinfo() instead of the non-standard gethostbyname2().millert1-5/+14
OK deraadt@ jca@ jung@ florian@
2016-05-23Remove iruserok(_sa)? and __ivaliduser(sa)?guenther2-90/+20
ok millert@ deraadt@
2016-05-23Eliminate __check_rhosts_file and __rcmd_errstr: they were only used byguenther1-5/+1
rlogind and rshd (remember them?) ok deraadt@
2016-05-01Remove old NeXT-specific cruft. From mmcc@millert1-13/+1
2016-04-05Prefer _MUTEX_*LOCK over _THREAD_PRIVATE_MUTEX_*LOCK() when thread-specificguenther1-4/+4
data isn't necessary. ok mpi@, ok&tweak natano@
2016-03-30for some time now mandoc has not required MLINKS to functionjmc1-54/+1
correctly - logically complete that now by removing MLINKS from base; authors need only to ensure there is an entry in NAME for any function/ util being added. MLINKS will still work, and remain for perl to ease upgrades; ok nicm (curses) bcook (ssl) ok schwarze, who provided a lot of feedback and assistance ok tb natano jung
2016-03-10un-vax;jmc1-3/+3