ip.7: Note a few more valid 'protocol' values

See https://bugzilla.kernel.org/show_bug.cgi?id=204981

Reported-by: Martin Doucha <mdoucha@suse.cz>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2020-04-23 11:12:05 +02:00
parent c5885e4fff
commit d8833593c7
1 changed files with 27 additions and 11 deletions

View File

@ -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