aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/net
Commit message (Collapse)AuthorAgeFilesLines
...
* Update SEE ALSO sections for resolver.{3,5} and hosts.5Gordon Bergling2022-09-151-4/+1
| | | | | | | | | | | | The mentioned document "Name Server Operations Guide for BIND" is outdated, so remove it from the SEE ALSO section of hosts.5 and resolver.{3,5}. PR: 266360 Reported by: Graham Perrin <grahamperrin at FreeBSD dot org> Reviewed by: karels MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D36557
* getaddrinfo(3): A typo fixedMaxim Konovalov2022-09-141-1/+1
| | | | PR: 266403
* sockatmark(3): Add references to 4.4BSD IPC tutorialsGordon Bergling2022-07-031-1/+16
| | | | | Obtained from: NetBSD MFC after: 3 days
* Bump .Dd for recently modified manual pagesFernando Apesteguía2022-06-277-7/+7
| | | | | | | | During the removal of named(8) references, some pages were modified but their .Dd where not updated accordingly. Reported by: lwhsu@ Fixes: 942e234d868d
* Remove references to named(8)Fernando Apesteguía2022-06-267-18/+8
| | | | | | | | named(8) hasn't been in base for some time. Remove all references to it in manual pages. Approved by: manpages (Pau Amma) Differential Revision: https://reviews.freebsd.org/D35586
* getnetent(3): Add documentation for missing reentrant functionsFernando Apesteguía2022-06-202-2/+30
| | | | | | | | | | Add gethostbyname_r, gethostbyname2_r and gethostbyaddr_r signatures and descriptions. PR: 249154 Reported by: asomers@ Approved by: manpages (imp@), Pau Amma Differential Revision: https://reviews.freebsd.org/D30385
* getnetent(3): Add missing reentrant functionsFernando Apesteguía2022-06-202-5/+35
| | | | | | | | | | | Add documentation for gethostbyname_r, gethostbyname2_r and gethostbyaddr_r Create proper MLINKs for the new functions. PR: 249154 Reported by: asomers@ Approved by: manpages (0mp@), Pau Amma Differential Revision: https://reviews.freebsd.org/D30469
* if_indextoname(3): Correct the RFC in a commentGordon Bergling2022-04-031-1/+1
| | | | | | | | | RFC 2533 refers to 'A Syntax for Describing Media Feature Sets', which is wrong since the correct reference should be RFC 2553 'Basic Socket Interface Extensions for IPv6'. Obtained from: OpenBSD MFC after: 1 week
* /etc/hosts: Wording changes to better match RFC 1918Pedro F. Giffuni2022-03-051-6/+6
| | | | | | | | Summary: No functional change. Subscribers: imp Differential Revision: https://reviews.freebsd.org/D34391
* libc: Fix build with -DNS_REREAD_CONF.Alexander Motin2021-12-291-0/+2
| | | | MFC after: 3 days
* Revert "wpa: Import wpa_supplicant/hostapd commit 14ab4a816"Cy Schubert2021-12-021-1/+5
| | | | | | | | This reverts commit 266f97b5e9a7958e365e78288616a459b40d924a, reversing changes made to a10253cffea84c0c980a36ba6776b00ed96c3e3b. A mismerge of a merge to catch up to main resulted in files being committed which should not have been.
* wpa: Import wpa_supplicant/hostapd commit 14ab4a816Cy Schubert2021-12-021-5/+1
| | | | | | This is the November update to vendor/wpa committed upstream 2021-11-26. MFC after: 1 month
* libc sctp: improve conformance of sctp_getpaddrs()Michael Tuexen2021-12-011-1/+5
| | | | | | | | When there is no association, don't return -1 and indicate ENOENT, but return 0 instead. This is specified in RFC 6458. PR: 260117 MFC after: 1 week
* libc sctp: fix sctp_getladdrs() when reporting no addressesMichael Tuexen2021-12-011-4/+4
| | | | | | | | | | Section 9.5 of RFC 6458 (SCTP Socket API) requires that sctp_getladdrs() returns 0 in case the socket is unbound. This is the cause of reporting 0 addresses. So don't indicate an error, just report this case as required. PR: 260117 MFC after: 1 week
* libc sctp: improve error reporting of sctp_getladdrs()Michael Tuexen2021-12-011-2/+0
| | | | | | Do not hide errno from getsockopt() called internally. MFC after: 1 week
* libc sctp: fix sctp_getladdrs() for 64-bit BE platformsMichael Tuexen2021-12-011-10/+10
| | | | | | | | | When calling getsockopt() with SCTP_GET_LOCAL_ADDR_SIZE, use a pointer to a 32-bit variable, since this is what the kernel expects. While there, do some cleanups. MFC after: 1 week
* libc/net/nscachedcli.c: remove write-only variablesKonstantin Belousov2021-11-291-4/+2
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* libc/net/getservent.c: Mark write-only variables as unusedKonstantin Belousov2021-11-291-8/+8
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* libc/net/getprotoent.c: Mark write-only variables as unusedKonstantin Belousov2021-11-291-6/+6
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* libc/net/getnetnamadr.c: Mark write-only variables as unusedKonstantin Belousov2021-11-291-8/+8
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* libc/net/gethostnamadr.c: mark write-only variables as __unusedKonstantin Belousov2021-11-291-8/+8
| | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* man pages: deprecate Internet Class A/B/CMike Karels2021-11-092-23/+13
| | | | | | | | | | | Mark functions inet_netof(), inet_lnaof(), and inet_makeaddr() as deprecated, as they assume Class A/B/C. inet_makeaddr() mostly works when networks are a multiple of 8 bits, but warn for anything other than historical classes. Reduce other mentions of network classes. MFC after: 1 month Reviewed by: bcr, #manpages Differential Revision: https://reviews.freebsd.org/D32711
* Retire synchronous PPP kernel driver sppp(4).Gleb Smirnoff2021-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The last two drivers that required sppp are cp(4) and ce(4). These devices are still produced and can be purchased at Cronyx <http://cronyx.ru/hardware/wan.html>. Since Roman Kurakin <rik@FreeBSD.org> has quit them, they no longer support FreeBSD officially. Later they have dropped support for Linux drivers to. As of mid-2020 they don't even have a developer to maintain their Windows driver. However, their support verbally told me that they could provide aid to a FreeBSD developer with documentaion in case if there appears a new customer for their devices. These drivers have a feature to not use sppp(4) and create an interface, but instead expose the device as netgraph(4) node. Then, you can attach ng_ppp(4) with help of ports/net/mpd5 on top of the node and get your synchronous PPP. Alternatively you can attach ng_frame_relay(4) or ng_cisco(4) for HDLC. Actually, last time I used cp(4) back in 2004, using netgraph(4) instead of sppp(4) was already the right way to do. Thus, remove the sppp(4) related part of the drivers and enable by default the negraph(4) part. Further maintenance of these drivers in the tree shouldn't be a big deal. While doing that, remove some cruft and enable cp(4) compilation on amd64. The ce(4) for some unknown reason marks its internal DDK functions with __attribute__ fastcall, which most likely is safe to remove, but without hardware I'm not going to do that, so ce(4) remains i386-only. Reviewed by: emaste, imp, donner Differential Revision: https://reviews.freebsd.org/D32590 See also: https://reviews.freebsd.org/D23928
* Correct section reference for examples in RFC3542Tom Jones2021-08-011-2/+2
| | | | | | Reviewed by: bz, network MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D26272
* Revert "lib/libc/net/nsdispatch.c: Fix missing unlock and add locking ↵Alex Richardson2021-04-191-129/+72
| | | | | | | | | | | | annotations" This commit should not have introduced any functional changes, but apparently it did. This appears to have broken LDAP setups. Reverting for now. Will reland once I have fixed the breakage. This reverts commit 5245bf7b92b74e556527b4916a8deba386fe5772. Reported By: Александр Недоцуков, brd MFC after: immediately
* lib/libc/net/nsdispatch.c: Fix missing unlock and add locking annotationsAlex Richardson2021-03-251-72/+129
| | | | | | | | | | | | | The error cases (goto fin) of _nsdispatch were missing the unlock. This change also drops the checks for __isthreaded since the pthread stubs are already no-ops if threads are not being used. Dropping those conditionals allows clang's thread safety analysis to deal with the file and also makes the code a bit more readable. While touching the file also add a few more assertions in debug mode that the right locks are held. Reviewed By: markj Differential Revision: https://reviews.freebsd.org/D29372
* libc: Fix most issues reported by mandocGordon Bergling2020-12-191-20/+20
| | | | | | | | | | | | | | - varios "new sentence, new line" warnings - varios "sections out of conventional order" warnings - varios "unusual Xr order" warnings - varios "missing section argument" warnings - varios "no blank before trailing delimiter" warnings - varios "normalizing date format" warnings MFC after: 1 month Notes: svn path=/head/; revision=368817
* Eliminate duplicate `afterinstallconfigs` targetEnji Cooper2020-10-011-1/+2
| | | | | | | | | | | | | | | | | Define separate dependent targets which `afterinstallconfigs` relies on, in order to modify `${DESTDIR}/etc/master.passwd` and `${DESTDIR}/etc/nsswitch.conf`. Mark these targets .PHONY, since they manipulate configurations on the fly and the generation logic isn't 100% defined in terms of the source files/logic, and is variable, based on MK_foo flags. MFC after: 2 weeks Reviewed by: bapt, brd Differential Revision: https://reviews.freebsd.org/D20330 Notes: svn path=/head/; revision=366327
* Add include missing from my last commit.Michael Tuexen2020-06-211-0/+1
| | | | Notes: svn path=/head/; revision=362474
* Cleanup the defintion of struct sctp_getaddresses. This stuctureMichael Tuexen2020-06-211-8/+8
| | | | | | | | | | is used by the IPPROTO_SCTP level socket options SCTP_GET_PEER_ADDRESSES and SCTP_GET_LOCAL_ADDRESSES, which are used by libc to implement sctp_getladdrs() and sctp_getpaddrs(). These changes allow an old libc to work on a newer kernel. Notes: svn path=/head/; revision=362473
* Use a struct sockaddr_in pr struct sockaddr_in6 as the option valueMichael Tuexen2020-06-201-22/+13
| | | | | | | | | | | for the IPPROTO_SCTP level socket options SCTP_BINDX_ADD_ADDR and SCTP_BINDX_REM_ADDR. These socket option are intended for internal use only to implement sctp_bindx(). This is one user of struct sctp_getaddresses less. struct sctp_getaddresses is strange and will be changed shortly. Notes: svn path=/head/; revision=362451
* Whitespace changes, not functional change intended.Michael Tuexen2020-06-181-22/+23
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=362332
* libc: Shortcut if_indextoname() if index == 0Kristof Provost2020-04-231-0/+5
| | | | | | | | | | | | | | | If the index we're trying to convert is 0 we can avoid a potentially expensive call to getifaddrs(). No interface has an ifindex of zero, so we can handle this as an error: set the errno to ENXIO and return NULL. Submitted by: Nick Rogers Reviewed by: lutz at donnerhacke.de MFC after: 2 weeks Sponsored by: RG Nets Differential Revision: https://reviews.freebsd.org/D24524 Notes: svn path=/head/; revision=360231
* Fix -Wvoid-pointer-to-enum-cast warnings.Brooks Davis2020-04-154-18/+18
| | | | | | | | | | | | | | | | | This pattern is used in callbacks with void * data arguments and seems both relatively uncommon and relatively harmless. Silence the warning by casting through uintptr_t. This warning is on by default in Clang 11. Reviewed by: arichardson Obtained from: CheriBSD (partial) MFC after: 1 week Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D24425 Notes: svn path=/head/; revision=359978
* Improve validation of the sockaddr length in iruserok_sa().Mark Johnston2020-02-051-2/+2
| | | | | | | | | | | Negative numbers are not valid sockaddr lengths. PR: 243747 Submitted by: Andrew Reiter <areiter@veracode.com> MFC after: 1 week Notes: svn path=/head/; revision=357575
* Increase YPMAXRECORD to 16M to be compatible with Linux.Konstantin Belousov2019-08-123-10/+19
| | | | | | | | | | | | | | | | | | | | | | | Since YP protocol definition uses the constant to declare variable-size opaque byte strings, the change should be binary compatible with existing installations which do not expose keys or values larger than 1024 bytes. All uses of local variables with YPMAXRECORD sizes were removed to avoid insane stack use. On the other hand, variables with static lifetime should be fine and only result in increased VA use. Glibc made same change, increasing the allowed length for keys and values in YP to 16M, in 2013. Reviewed by: markj Discussed with: ian Sponsored by: Mellanox Technologies MFC after: 3 weeks Differential revision: https://reviews.freebsd.org/D20900 Notes: svn path=/head/; revision=350957
* typo: suppported.Pedro F. Giffuni2019-05-291-1/+1
| | | | Notes: svn path=/head/; revision=348349
* Use IN_foo() macros from sys/netinet/in.h inplace of handcrafted codeRodney W. Grimes2019-04-041-4/+2
| | | | | | | | | | | | | | | | There are a few places that use hand crafted versions of the macros from sys/netinet/in.h making it difficult to actually alter the values in use by these macros. Correct that by replacing handcrafted code with proper macro usage. Reviewed by: karels, kristof Approved by: bde (mentor) MFC after: 3 weeks Sponsored by: John Gilmore Differential Revision: https://reviews.freebsd.org/D19317 Notes: svn path=/head/; revision=345888
* Use correct buffer sizes in sctp_get[lp]addrs().Michael Tuexen2019-03-021-4/+2
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=344722
* Sync "struct addrinfo" declaration with netdb.h.Sergey Kandaurov2019-02-101-9/+9
| | | | | | | | | | | Notably, unlike in OpenBSD, which the man page was copied from, ai_canonname and ai_addr come in different order. PR: 225880 MFC after: 1 week Notes: svn path=/head/; revision=343967
* gai_strerror() - Update string error messages according to RFC 3493.Pedro F. Giffuni2018-12-232-28/+25
| | | | | | | | | | | | | | | | | | | Error messages in gai_strerror(3) vary largely among OSs. For new software we largely replaced the obsoleted EAI_NONAME and with EAI_NODATA but we never updated the corresponding message to better match the intended use. We also have references to ai_flags and ai_family which are not very descriptive for non-developer end users. Bring new new error messages based on informational RFC 3493, which has obsoleted RFC 2553, and make them consistent among the header adn manpage. MFC after: 1 month Differentical Revision: D18630 Notes: svn path=/head/; revision=342379
* Style cleanup.Dag-Erling Smørgrav2018-11-271-16/+14
| | | | Notes: svn path=/head/; revision=341009
* Don't call stat(2) on nsswitch.conf(5) every time nsdispatch(3)Edward Tomasz Napierala2018-11-101-0/+11
| | | | | | | | | | | | | | | | | | | and dependent functions (eg getpwname(3)) get called. This can improve performance of binaries that perform a lot of name lookups, such as gssd(8). It also matches documented behaviour of Linux and Solaris. The old code is left in place, should anyone need it, guarded by #ifdef NS_REREAD_CONF. Reviewed by: imp, bcr MFC after: 2 weeks Relnotes: yes Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17934 Notes: svn path=/head/; revision=340339
* Prevent flex(1) from generating calls to isatty(3) - and, in turn,Edward Tomasz Napierala2018-10-151-0/+1
| | | | | | | | | | | | | TIOCGETA ioctls - when parsing nsswitch.conf(5). Reviewed by: imp, markj Approved by: re (gjb) MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17564 Notes: svn path=/head/; revision=339368
* Don't call dlopen(3) for built-in NSS types - "cache", "compat",Edward Tomasz Napierala2018-10-152-7/+14
| | | | | | | | | | | | | | "dns", "files", "db", and "nis". It saves some path lookups during binary startup. Reviewed by: markj Approved by: re (gjb, kib) MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D17557 Notes: svn path=/head/; revision=339363
* Move hosts, hosts.equiv, networks, nsswitch.conf, protocols to lib/libc/net/Brad Davis2018-09-176-0/+232
| | | | | | | | | | | | | | This uses relative paths to make it more specific to avoid any potential future problems with .PATH and leverages CONFS. libc was picked as the destination location for these because of the syscalls that use these files as the lowest level place they are referenced. Approved by: re (gjb), will (mentor) Differential Revision: https://reviews.freebsd.org/D17164 Notes: svn path=/head/; revision=338729
* Remove support for the Arcnet protocol.Brooks Davis2018-04-131-1/+0
| | | | | | | | | | | | | | | | | | While Arcnet has some continued deployment in industrial controls, the lack of drivers for any of the PCI, USB, or PCIe NICs on the market suggests such users aren't running FreeBSD. Evidence in the PR database suggests that the cm(4) driver (our sole Arcnet NIC) was broken in 5.0 and has not worked since. PR: 182297 Reviewed by: jhibbits, vangyzen Relnotes: yes Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D15057 Notes: svn path=/head/; revision=332490
* Make getnameinfo(3) salen requirement less strict andHiroki Sato2018-03-152-9/+33
| | | | | | | | | | | | | | | | | | | | | | | document details of salen in getnameinfo(3) manual page. getnameinfo(3) returned EAI_FAIL when salen was not equal to the length corresponding to the value specified by sa->sa_family. However, POSIX or RFC 3493 does not require it and RFC 4038 Sec.6.2.3 shows an example passing sizeof(struct sockaddr_storage) to salen. This change makes the requirement less strict by accepting salen up to sizeof(struct sockaddr_storage). It also includes two more changes: one is to fix return values because both SUSv4 and RFC 3493 require EAI_FAMILY when the address length is invalid, another is to fix sa_len dependency in PF_LOCAL. Pointed out by: Christophe Beauval Reviewed by: ae Differential Revision: https://reviews.freebsd.org/D14585 Notes: svn path=/head/; revision=331000
* The source strings are from the password database which guaranteesWarner Losh2018-01-061-2/+2
| | | | | | | | | | that the data going into it is sane. Out of an abundance of caution, limit the string copies to prevent an overflow. CID: 1019035 Notes: svn path=/head/; revision=327619
* Don't ignore trailing spaces after numerical IP addresses.Hajimu UMEMOTO2017-12-201-1/+2
| | | | | | | | | | PR: 224403 Reported by: Michael Kaufmann Reviewed by: Michael Kaufmann MFC after: 1 week Notes: svn path=/head/; revision=327029