Bug 1110401 - Error on unix(7) man page: SIOCINQ/FIONREAD description for SOCK_DGRAM
Summary: Error on unix(7) man page: SIOCINQ/FIONREAD description for SOCK_DGRAM
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: man-pages
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Chaloupka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-17 14:48 UTC by Bob Doolittle
Modified: 2015-06-10 19:18 UTC (History)
8 users (show)

Fixed In Version: man-pages-3.69-4.fc21
Clone Of:
Environment:
Last Closed: 2015-06-10 19:08:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Exercise fionread behavior (10.00 KB, application/x-tar)
2014-06-17 14:48 UTC, Bob Doolittle
no flags Details

Description Bob Doolittle 2014-06-17 14:48:35 UTC
Created attachment 909619 [details]
Exercise fionread behavior

Description of problem:

The unix(7) man page has an incorrect description of behavior for SIOCINQ/FIONREAD. It states that the return value is the "amount of queued unread data in the receive buffer". That is true only for sockets of type SOCK_STREAM.

For SOCK_DGRAM, the return value is the size of the next queued packet available to be read. If there are multiple packets queued in the receive buffer, it returns the length of the next packet to be read, not the total amount of queued unread data (i.e. all packets).

Version-Release number of selected component (if applicable):

Fedora 20

How reproducible:
100%

Steps to Reproduce:
I have attached (a tarball of) two programs to demonstrate the SOCK_DGRAM behavior.
1. Run test_fionread, but don't type anything yet
2. (on the same host) Run test_sendto, and type in several lines, each of which will be sent in individual packets and queued to be read.
3. Go back to test_fionread, and press "Return" to cause the reads to begin.

You will see that FIONREAD will report the length of each queued packet before reading it, even though there are multiple queued packets and total queued data is larger.

Additional info:

Please correct the man page, rather than changing the behavior of FIONREAD to match the man page. If you compare to the udp(7) man page description of FIONREAD you will see that the Unix SOCK_DGRAM behavior matches that description. You might simply borrow that text for the SOCK_DGRAM description.

Comment 1 Bob Doolittle 2014-06-17 15:39:43 UTC
Note the behavior I describe above *probably* also applies to SOCK_SEQPACKET sockets, but I haven't tested that. Should touch up man page text appropriately for both SOCK_DGRAM and SOCK_SEQPACKET.

Comment 2 Jan Chaloupka 2014-07-24 05:27:20 UTC
Solving in thread:
 
http://www.spinics.net/lists/linux-man/msg06478.html

Comment 3 Fedora End Of Life 2015-05-29 12:08:38 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Jan Chaloupka 2015-05-29 19:38:58 UTC
Hi Bob,

sorry about the delay. The patch was already merged in upstream for some time.

f20:
https://lists.fedoraproject.org/pipermail/scm-commits/Week-of-Mon-20150525/1582897.html

21:
https://lists.fedoraproject.org/pipermail/scm-commits/Week-of-Mon-20150525/1582898.html

Comment 5 Fedora Update System 2015-05-29 19:45:14 UTC
man-pages-3.69-4.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/man-pages-3.69-4.fc21

Comment 6 Fedora Update System 2015-05-29 19:45:41 UTC
man-pages-3.53-6.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/man-pages-3.53-6.fc20

Comment 7 Fedora Update System 2015-06-01 17:04:33 UTC
Package man-pages-3.69-4.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing man-pages-3.69-4.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-9258/man-pages-3.69-4.fc21
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2015-06-10 19:08:14 UTC
man-pages-3.53-6.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2015-06-10 19:18:34 UTC
man-pages-3.69-4.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.


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