From d8833593c704fffec95ad513c5282337aa4f2d3a Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Thu, 23 Apr 2020 11:12:05 +0200 Subject: [PATCH] ip.7: Note a few more valid 'protocol' values See https://bugzilla.kernel.org/show_bug.cgi?id=204981 Reported-by: Martin Doucha Signed-off-by: Michael Kerrisk --- man7/ip.7 | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/man7/ip.7 b/man7/ip.7 index 59f05ae37..2ea454748 100644 --- a/man7/ip.7 +++ b/man7/ip.7 @@ -78,28 +78,44 @@ An IP socket is created using .PP socket(AF_INET, socket_type, protocol); .PP -Valid socket types are +Valid socket types include .B SOCK_STREAM -to open a -.BR tcp (7) -socket, +to open a stream socket, .B SOCK_DGRAM -to open a -.BR udp (7) -socket, or +to open a datagram socket, and .B SOCK_RAW to open a .BR raw (7) socket to access the IP protocol directly. +.PP .I protocol is the IP protocol in the IP header to be received or sent. -The only valid values for +Valid values for .I protocol -are 0 and +include: +.IP \(bu 2 +0 and .B IPPROTO_TCP -for TCP sockets, and 0 and +for +.BR tcp (7) +stream sockets; +.IP \(bu +0 and .B IPPROTO_UDP -for UDP sockets. +for +.BR udp (7) +datagram sockets; +.IP \(bu +.B IPPROTO_SCTP +for +.BR sctp (7) +stream sockets; and +.IP \(bu +.B IPPROTO_UDPLITE +for +.BR udplite (7) +datagram sockets. +.PP For .B SOCK_RAW you may specify a valid IANA IP protocol defined in