aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/net
Commit message (Collapse)AuthorAgeFilesLines
* libc: Disable debugging code in the resolver.Dag-Erling Smørgrav12 days2-2/+8
| | | | | Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D37319
* link_addr: be more strict about address formatsLexi Winter2025-05-152-80/+152
| | | | | | | | | | | | | | | | | | | | | | instead of accepting any character as a delimiter, only accept ':', '.' and '-', and only permit a single delimiter in an address. this prevents accepting bizarre addresses like: ifconfig epair2a link 10.1.2.200/28 ... which is particularly problematic on an INET6-only system, in which case ifconfig defaults to the 'link' family, meaning that: ifconfig epair2a 10.1.2.200/28 ... changes the Ethernet address of the interface. bump __FreeBSD_version so link_addr() consumers can detect the change. Reviewed by: kp, des Approved by: des (mentor) Differential Revision: https://reviews.freebsd.org/D49936
* libc: add link_ntoa_r()Lexi Winter2025-05-074-28/+134
| | | | | | | | | | | | this is a re-entrant version of link_ntoa. use an in-out parameter for the buffer size, so the user requires at most two calls to determine the needed size. reimplement link_ntoa using link_ntoa_r with a static buffer. Reviewed by: des Approved by: des (mentor) Differential Revision: https://reviews.freebsd.org/D50202
* nsswitch.conf: Avoid modification after installationMark Johnston2025-04-071-4/+8
| | | | | | | | | | | | | | | | | | | | | To implement WITHOUT_NIS, we have a hack in the build which modifies the installed nsswitch.conf to remove NIS compat providers and databases. This hack operates on the installed nsswitch.conf, which means that the installed file size won't match that listed in the metalog. One option would be to maintain two copies of nsswitch.conf, one for each configuration, but that would result in duplication and I don't see a clear way around that. Instead, stage a copy of nsswitch.conf in the libc objdir, and modify that one before installing, so that the version recorded in the metalog matches what actually gets installed. PR: 209718 Reviewed by: kevans, emaste Sponsored by: Klara, Inc. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D49300
* libc/getaddrinfo(2): return EAI_AGAIN on nameserver timeoutGleb Smirnoff2025-03-281-15/+43
| | | | | | | | | | | | | A nameserver timeout is a soft failure, future attempts may succeed. Returning EAI_AGAIN is crucial for API users to tell a soft name resolution failure from negative resolution result. Before the change we would return EAI_ADDRFAMILY, which I believe, is a regression from 144361386696, and before that revision we used to return EAI_NONAME in most of the cases. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D49411
* manuals: Remove trailing spacesGraham Percival2024-11-041-1/+1
| | | | | | | | | | This does not change the rendered ascii at all. Signed-off-by: Graham Percival <gperciva@tarsnap.com> Reviewed by: mhorne, Alexander Ziaee <concussious.bugzilla@runbox.com> MFC after: 3 days Sponsored by: Tarsnap Backup Inc. Pull Request: https://github.com/freebsd/freebsd-src/pull/1473
* getaddrinfo.{1,3}: Cross-reference ip6addrctl(8)Jose Luis Duran2024-09-061-1/+2
| | | | | Reviewed by: imp, glebius Pull Request: https://github.com/freebsd/freebsd-src/pull/1375
* libc/getnameinfo: stop adding NI_NUMERICHOST where inappropriateBjoern A. Zeeb2024-07-261-17/+37
| | | | | | | | | | | | | | | | | | | | | | | | Checking the first nibble of the IPv6 address to be 0 and then excluding two well known cases (v4-mapped, loopback) leaves us with more cases where the first nibble could be 0, e.g., the RFC 6052, 2.1 Well-Known Prefix 64:ff9b::/96. It is not practical to track them all and it is not clear what lead to this special casing originally, so remove them. While here also remove the IN6_IS_ADDR_LINKLOCAL() + NI_NUMERICHOST case as link-local address resolution does exist. We do leave the IN6_IS_ADDR_MULTICAST() case for now as I could not find any references to any official reverse lookups for these. Adding comments for more case (and some historic behaviour) in order to make it easier to follow the logic. PR: 279618 Fixes: 6cb9418289f90 MFC after: 6 weeks Reviewed by: hrs Differential Revision: https://reviews.freebsd.org/D45547
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* sctp: document sctp_recvmsg as implementedMichael Tuexen2024-05-021-3/+3
| | | | | PR: 275990 MFC after: 3 days
* libc: don't try to export _nsdbtdumpBrooks Davis2024-04-161-1/+0
| | | | | | | It is only present when compiling nsdispatch.c with -D_NSS_DEBUG and we provide no mechanism to do so. Differential Revision: https://reviews.freebsd.org/D44187
* libc: only export hesiod symbols when enabledBrooks Davis2024-04-163-10/+13
| | | | | | | Create a seperate symbol file for hesiod and conditionally include it. This allows linkage with --no-undefined-version. Differential Revision: https://reviews.freebsd.org/D44184
* libsys: move __libsys_interposer consumersBrooks Davis2024-02-053-99/+1
| | | | | | | | | | | | These system call wrappers call interposed system calls in fairly trivial ways. Move them over to libsys so all __libsys_interposer consumers end up in libsys. Also move recvmmsg and sendmmsg as they are documented with recv and send. Reviewed by: kib, emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/908
* libc: split libc and syscall interposing (1/2)Brooks Davis2024-02-052-2/+2
| | | | | | | | | | | | | | System calls or their wrappers are now interposed by __libsys_interposing with purely libc entries remaining in __libc_interposing. Use __libsys_interposing_slot in libthr to update __libsys_interposing, but also make __libc_interposing_slot fall back to __libsys_interposing_slot so an out of date libc has a chance of working during updates. Reviewed by: kib, emaste, imp Pull Request: https://github.com/freebsd/freebsd-src/pull/908
* sctp: update manpagesLexi Winter2024-02-038-21/+449
| | | | | | | | | | | | | | Add missing documentation for sctp_sendv(3) and sctp_recvv(3). Add a note that sctp_send(3), sctp_sendx(3) and sctp_recvmsg(3) are deprecated by RFC 6458. Add a STANDARDS section to all functions specified in RFC 6458 to indicate their standards conformance. MFC after: 2 weeks Reviewed by: imp, bcr, kp, tuexen Pull Request: https://github.com/freebsd/freebsd-src/pull/965
* libc: Annotate a couple of local functions as suchMark Johnston2024-01-291-2/+2
| | | | | | No functional change intended. MFC after: 1 week
* inet(3): clarify syntax accepted by inet_ptonMike Karels2024-01-271-9/+15
| | | | | | | | | | | | | The section INTERNET ADDRESSES describes the acceptance of dotted values with varying number of parts in multiple bases. This applies to inet_aton and inet_addr, but not to inet_pton. Clarify this section by listing the functions to which this applies. Move the description of what inet_pton accepts into this section from STANDARDS, where it is easily missed. Rename the section to clarify that it applies only to IPv4. (inet_pton also works with IPv6.) Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D43537
* resolv: Add a required include to resolv.hJan Beich2024-01-081-4/+1
| | | | | | | | Add a required include to resolv.h for sockaddr_in. This should reduce patching required when porting code written with Linux or NetBSD in mind. PR: 182466 MFC after: 1 week
* lib: Remove ancient SCCS tags.Warner Losh2023-11-2733-82/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* libc: centralize ntoh symbolsBrooks Davis2023-11-151-0/+4
| | | | | | | | These are implemented by net/ntoh.c via headers and compiler intrinsics so declare them in net/Symbol.map. Reviewed by: imp, kib, emaste Differential Revision: https://reviews.freebsd.org/D42615
* libc: Remove empty comments in Symbol.mapBrooks Davis2023-11-151-3/+0
| | | | | | | These were left over from $FreeBSD$ removal. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D42612
* libc: Purge unneeded cdefs.hWarner Losh2023-11-0142-43/+0
| | | | | | | | | These sys/cdefs.h are not needed. Purge them. They are mostly left-over from the $FreeBSD$ removal. A few in libc are still required for macros that cdefs.h defines. Keep those. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D42385
* libc: Fix missing or misspelled MLINKS.Dag-Erling Smørgrav2023-10-181-37/+86
| | | | Differential Revision: https://reviews.freebsd.org/D42192
* hesiod: Modernize.Dag-Erling Smørgrav2023-10-181-29/+13
| | | | | Reviewed by: zlei Differential Revision: https://reviews.freebsd.org/D42190
* Purge more stray embedded $FreeBSD$ stringsJohn Baldwin2023-09-251-6/+0
| | | | | | | These do not use __FBSDID but instead use bare char arrays. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D41957
* Remove $FreeBSD$: one-line nroff patternWarner Losh2023-08-1616-16/+0
| | | | Remove /^\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-1622-44/+0
| | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-166-6/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-1642-84/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-161-1/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-163-6/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* inet.3: remove mention of VAX endiannessEd Maste2023-08-011-11/+0
| | | | | | | | Machine endianness is not very important in understanding the inet* functions; the endianness of the VAX is especially so. PR: 272728 Sponsored by: The FreeBSD Foundation
* spdx: The BSD-2-Clause-NetBSD identifier is obsolete, drop -NetBSDWarner Losh2023-05-123-3/+3
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-NetBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-1213-13/+13
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* libc: Use secure_getenv(3) where appropriateMark Johnston2023-03-272-9/+3
| | | | | | | No functional change intended. Reviewed by: mjg, imp, kib Differential Revision: https://reviews.freebsd.org/D39278
* Document gethostbyname_r's public exposure in 6.2.David E. O'Brien2023-03-131-0/+4
|
* inet6_opt_init.3: Some enhancementsGordon Bergling2023-02-251-13/+15
| | | | | | | | | | - Be consistent with RFC references, so add a space after 'RFC' - Add a LIBRARY section - Use standard integer types in the SYNOPSIS section Obtained from: DragonflyBSD MFC after: 5 days Differential Revision: https://reviews.freebsd.org/D27548
* libc: base64: trim some bogus trailing whitespaceKyle Evans2023-02-081-4/+4
| | | | | | No functional change, just a style fix. Sponsored by: Klara, Inc.
* getservent.3: Mention the service.dbGordon Bergling2022-12-071-2/+4
| | | | | | | | - reference /var/db/services.db - reference services_mkdb(8) Obtained from: NetBSD MFC after: 3 days
* libc: Don't warn about RRSIG replies.Dag-Erling Smørgrav2022-11-092-2/+5
| | | | | | PR: 213178 MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D37303
* getaddrinfo: distinguish missing addrs from unresolvable namesMike Karels2022-11-021-5/+11
| | | | | | | | | | | | | | | | | | | Rework getaddrinfo(3) to return different error values for unresolvable names (same as before, EAI_NONAME) and those without a requested addr (EAI_ADDRFAMILY) when using DNS. This is implemented via an added error in the nsswitch layer, NS_ADDRFAMILY, which is used only by getaddrinfo(). The error is passed through nsdispatch(3), but that routine has no changes to handle this error. The error originates in the getaddrinfo DNS layer called via nsdispatch(), and is processed by the search layer that calls nsdispatch(). While here, add a little style to returns near those that were modified. Reviewed in https://reviews.freebsd.org/D37139 with related changes. Reviewed by: bz MFC after: 1 month
* gai_strerror.[c3]: re-enable EAI_ADDRFAMILY, EAI_NODATAMike Karels2022-11-022-7/+20
| | | | | | | | | | | | gai_strerror.c still has messages for EAI_ADDRFAMILY and EAI_NODATA, but not the man page. Re-add to the man page, and update comments in the source. Document the errors that are not in RFC 3493 or POSIX. Reviewed in https://reviews.freebsd.org/D37139 with related changes. Reviewed by: bz, pauamma MFC after: 1 month
* 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