Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Oct 2012 10:36:34 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r241997 - stable/9/share/man/man4
Message-ID:  <201210241036.q9OAaYP2096085@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Wed Oct 24 10:36:33 2012
New Revision: 241997
URL: http://svn.freebsd.org/changeset/base/241997

Log:
  Merge r240386, r240735 from head:
    Document conditions for IP_SENDSRCADDR socket option.
  
    Obtained from:        r167342 commit message

Modified:
  stable/9/share/man/man4/ip.4
Directory Properties:
  stable/9/share/man/man4/   (props changed)

Modified: stable/9/share/man/man4/ip.4
==============================================================================
--- stable/9/share/man/man4/ip.4	Wed Oct 24 10:32:39 2012	(r241996)
+++ stable/9/share/man/man4/ip.4	Wed Oct 24 10:36:33 2012	(r241997)
@@ -32,7 +32,7 @@
 .\"     @(#)ip.4	8.2 (Berkeley) 11/30/93
 .\" $FreeBSD$
 .\"
-.Dd June 12, 2012
+.Dd September 20, 2012
 .Dt IP 4
 .Os
 .Sh NAME
@@ -172,9 +172,7 @@ cmsg_type = IP_RECVDSTADDR
 .Pp
 The source address to be used for outgoing
 .Tn UDP
-datagrams on a socket that is not bound to a specific
-.Tn IP
-address can be specified as ancillary data with a type code of
+datagrams on a socket can be specified as ancillary data with a type code of
 .Dv IP_SENDSRCADDR .
 The msg_control field in the msghdr structure should point to a buffer
 that contains a
@@ -189,6 +187,20 @@ cmsg_level = IPPROTO_IP
 cmsg_type = IP_SENDSRCADDR
 .Ed
 .Pp
+The socket should be either bound to
+.Dv INADDR_ANY
+and a local port, and the address supplied with
+.Dv IP_SENDSRCADDR
+should't be
+.Dv INADDR_ANY ,
+or the socket should be bound to a local address and the address supplied with
+.Dv IP_SENDSRCADDR
+should be
+.Dv INADDR_ANY .
+In the latter case bound address is overriden via generic source address
+selection logic, which would choose IP address of interface closest to
+destination.
+.Pp
 For convenience,
 .Dv IP_SENDSRCADDR
 is defined to have the same value as



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201210241036.q9OAaYP2096085>