Bug 204981 - Information in udplite(7) and sctp(7) contradicts ip(7)
Summary: Information in udplite(7) and sctp(7) contradicts ip(7)
Status: RESOLVED CODE_FIX
Alias: None
Product: Documentation
Classification: Unclassified
Component: man-pages (show other bugs)
Hardware: All Linux
: P1 low
Assignee: documentation_man-pages@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-24 12:45 UTC by Martin Doucha
Modified: 2020-04-23 12:57 UTC (History)
1 user (show)

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Martin Doucha 2019-09-24 12:45:50 UTC
ip(7) says that the only valid protocol values for socket(AF_INET, SOCK_STREAM, protocol) are 0 and IPPROTO_TCP. But sctp(7) says that IPPROTO_SCTP is also allowed.

Similarly, ip(7) says that the only valid protocol values for socket(AF_INET, SOCK_DGRAM, protocol) are 0 and IPPROTO_UDP. But udplite(7) says that IPPROTO_UDPLITE is also allowed.

Short test program which tries to open a socket with SOCK_STREAM+IPPROTO_SCTP or SOCK_DGRAM+IPPROTO_UDPLITE confirms that sctp(7) and udplite(7) are correct. Since ip(7) uses SOCK_STREAM and TCP interchangeably (similarly SOCK_DGRAM and UDP), this isn't trivial to fix so I should leave it to some better technical writer than me.

Quick links:
http://man7.org/linux/man-pages/man7/ip.7.html
http://man7.org/linux/man-pages/man7/udplite.7.html
http://man7.org/linux/man-pages/man7/sctp.7.html
Comment 1 Michael Kerrisk 2020-04-23 12:57:05 UTC
Thanks for the report. I confirmed the details. I reworked the relevant paragraphs of the manual page to say:

       Valid  socket  types  include SOCK_STREAM to open a stream socket,
       SOCK_DGRAM to open a datagram  socket,  and  SOCK_RAW  to  open  a
       raw(7) socket to access the IP protocol directly.

       protocol  is  the  IP  protocol in the IP header to be received or
       sent.  Valid values for protocol include:

       · 0 and IPPROTO_TCP for tcp(7) stream sockets;

       · 0 and IPPROTO_UDP for udp(7) datagram sockets;

       · IPPROTO_SCTP for sctp(7) stream sockets; and

       · IPPROTO_UDPLITE for udplite(7) datagram sockets.

Closing this report now. Please reopen if you think something is still lacking.

Note You need to log in before you can comment on or make changes to this bug.