Skip to content

Commit 2591a04

Browse files
committed
Document more details on Well-Known Services (WKS)
1 parent bc34a75 commit 2591a04

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

src/generic/wks.h

+24-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* wks.c -- Well known services RDATA parser
2+
* wks.c -- Well-Known Services (WKS) RDATA parser
33
*
44
* Copyright (c) 2023, NLnet Labs. All rights reserved.
55
*
@@ -20,11 +20,18 @@
2020
// getprotobyname_r exist on most BSDs and Linux, but not Windows.
2121
// The list of known protocols and services also differs between operating
2222
// systems and no list covers all IANA (links below) registered protocols
23-
// and services, which may cause compatibility issues.
23+
// and services, which may cause compatibility issues. Furthermore, even
24+
// getprotobyname_r and getservbyname_r are marked locale, meaning the locale
25+
// object is read without any form of synchronization, which may be an issue
26+
// for a library.
2427
//
2528
// https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml
2629
// https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml
2730
//
31+
// https://www.gnu.org/software/libc/manual/html_node/Protocols-Database.html
32+
// https://www.gnu.org/software/libc/manual/html_node/Services-Database.html
33+
// https://www.gnu.org/software/libc/manual/html_node/POSIX-Safety-Concepts.html
34+
// https://www.gnu.org/software/libc/manual/html_node/Other-Safety-Remarks.html
2835
//
2936
// WKS RRs are rarely used and a document to deprecate the RRTYPE (among
3037
// others) has been drafted (WKS removed from the second draft).
@@ -36,12 +43,26 @@
3643
// WKS RRs have been said to be deprecated in an informational document (NOT
3744
// a standard), although it wrongly claims WKS RRs are in fact deprecated.
3845
//
39-
// RFC1912 section 2.6.1:
46+
// RFC1912 section 2.6.1 (informational):
4047
// WKS records are deprecated in [RFC 1123]. They serve no known useful
4148
// function, except internally among LISP machines. Don't use them.
4249
//
4350
// https://datatracker.ietf.org/doc/html/rfc1912
4451
//
52+
// RFC1123 section 2.2 (standard):
53+
// An application SHOULD NOT rely on the ability to locate a WKS record
54+
// containing an accurate listing of all services at a particular host
55+
// address, since the WKS RR type is not often used by Internet sites.
56+
// To confirm that a service is present, simply attempt to use it.
57+
//
58+
// https://datatracker.ietf.org/doc/html/rfc1123
59+
//
60+
// RFC1127 section 2 (informational):
61+
// WKS Records Detracted [AS 2.2, 5.2.12, 6.1.3.6]
62+
// Recommend against using WKS records from DNS.
63+
//
64+
// https://datatracker.ietf.org/doc/html/rfc1127
65+
//
4566
//
4667
// Rather than supporting any protocol registered by IANA, support a small
4768
// subset of mnemonics (TCP and UDP) as well as numeric values and add

0 commit comments

Comments
 (0)