Capitalization in .SS sections across pages (and sometimes even
within a single page) is wildly inconsistent. Make it consistent.
Capitalize first word in heading, but otherwise use lower case,
except where English usage (e.g., proper nouns) or programming
language requirements (e.g., identifier names) dictate otherwise.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Problem:
When connect(2) is executed, the local port number may duplicate.
How reproducible:
When using parameter "net.ipv4.ip_local_port_range", a client may use
the same port to connect to the different sessions on the localhost.
Steps to Reproduce:
1.Change "net.ipv4.ip_local_port_range".
[Example]
net.ipv4.ip_local_port_range = 32768 32770
2.Connect to any two ports of LISTEN by telnet command.
[Example]
# netstat -antp | grep LISTEN
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 2828/smbd
tcp 0 0 0.0.0.0:21 0.0.0.0:* LISTEN 2800/vsftpd
#
# telnet 127.0.0.1 139
# telnet 127.0.0.1 21
# telnet 127.0.0.1 21
3.Duplication of a local transmission port.
[Example]
# netstat -antp
tcp 0 0 127.0.0.1:32769 127.0.0.1:139 ESTABLISHED 18147/telnet
tcp 0 0 127.0.0.1:32769 127.0.0.1:21 ESTABLISHED 18157/telnet
Actual results:
The local port number may duplicate.
Expected results:
The local port number doesn't duplicate.
Additional info:
[Investigation]
"man 7 ip" contains following text:
-----------------------------------------------------------------
When listen(2) or connect(2) are called on an unbound socket, it
is automatically bound to a random free port with the local
address set to INADDR_ANY.
-----------------------------------------------------------------
Although indicated as "it is automatically bound to a random free
port", the port number which is not free like in a reproduce
procedure may be bound. Therefore, based on the description of
this "man 7 ip", it can be judged that it is bug to use the local
port where the process duplicated.
--- Comment by Leitner, Flavio on 2/7/2012 2:55 PM ---
It's allowed to have multiple tasks using the same port (as a
result of calling connect(2)) as long as the other connection
information (4-tuple) differs to resolve the conflict. Thus,
it must be an unique 4-tuple consisting of source and
destination IP addresses and port numbers to not conflict.
In the example, the dest port is different.
tcp 0 0 127.0.0.1:32769 127.0.0.1:139 ESTABLISHED 18147/telnet
tcp 0 0 127.0.0.1:32769 127.0.0.1:21 ESTABLISHED 18157/telnet
Reported-by: Peter Schiffer <pschiffe@redhat.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This patch adds documentation of several source-specific multicast
socket options that were added to kernel with implementation
of IGMPv3 in 2.5.68.
The following socket options were added:
IP_ADD_SOURCE_MEMBERSHIP
IP_DROP_SOURCE_MEMBERSHIP
IP_BLOCK_SOURCE
IP_UNBLOCK_SOURCE
IP_MSFILTER
Information Sources:
* RFC 3376 - Internet Group Management Protocol, Version 3
http://tools.ietf.org/html/rfc3376
* RFC 3678 - Socket Interface Extensions for Multicast Source
Filters
http://tools.ietf.org/html/rfc3678
* Kernel source tree
net/ipv4/ip_sockglue.c
net/ipv4/igmp.c
* Test programs used in Linux Network Stack Test
http://git.fedorahosted.org/git/?p=lnst.git
test_tools/multicast/
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
In IPv4,IP_MTU is only supported by getsockopt.
In IPv6, we can use IPV6_MTU to set socket's MTU,
but the return value of getsockopt() is the path MTU.
Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
When SO_SNDTIMEO is set before connect(), then connect()
may return EWOULDBLOCK when the timeout fires.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Notes from Bert Hubert:
Recently PowerDNS needed to support the getting of the
original destination address of packets received on ::.
Following the advice in ipv6(7) generated an error on
setsockopt().
Some googling confirmed that setsockopt() with
IPV6_PKTINFO indeed does not work, but we found that
IPV6_RECVPKTINFO did.
Our experiences are detailed in
http://bert-hubert.blogspot.nl/2012/10/on-binding-datagram-udp-sockets-to-any.html
Please find attached a quite naive patch to ipv6.7 that at
least fixes 'my' problem, but does not document if
IPV6_PKTINFO ever worked as a flag. It does document that
IPV6_RECVPKTINFO is available since 2.6.13.
Please let me know if this patch is acceptable, or if you
want me to dig deeper into the IPV6_PKTINFO situation.
Notes from mtk:
Drop mention of IPV6_PKTINFO; that's IPV6_2292PKTINFO nowadays
(and needs to be documented). And, confusingly, there's nowadays
an IPV6_PKTINFO that is a quite different thig.
With kernel commit 333fad5364d6b457c8d837f7d05802d2aaf8a961
(Sep 2005) PV6_PKTINFO disappeared from the
getsockopt/setsockopt API, and IPV6_2292PKTINFO took its place.
Meanwhile, IPV6_RECVPKTINFO was added.
Then kernel commit b24a2516d10751d7ed5afb58420df25370c9dffb
(Dec 2008) added IPV6_PKTINFO back to the
getsockopt/getsockopt API, but with what looks to be a
rather different meaning (it takes a 'struct in6_pktinfo'
as the third arg).
This seems consistent (if confusing) with the RFCs:
http://www.ietf.org/rfc/rfc2292.txthttp://www.ietf.org/rfc/rfc3542.txt (obsoletes 2292)
Both of those RFCs define an IPV6_PKTINO sockopt, but the
former takes an int arg, and the latter takes a
'struct in6_pktinfo'.
So, my summary of your patch is that it's correct. (But I think
that IPV6_RECVPKTINFO is present since 2.6.14, not 2.6.13.)
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
The line(s) in the NAME section should only use capitals
where English usage dictates that. Otherwise, use
lowercase throughout.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Existing pages variously use "userspace or "user space".
But, "userspace" is not quite an English word.
So change "userspace" to "user space" or, when used
attributively, "user-space".
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>