diff options
author | glebius <glebius@FreeBSD.org> | 2012-09-12 10:09:34 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2012-09-12 10:09:34 +0000 |
commit | c94209caab986a73c2087101018e42d24c60b3e4 (patch) | |
tree | 272704a14247b89c6d2ab63832a7be213cd5e74e /share/man | |
parent | 78d32fb722160149b58efdea9e1bf8865786ee9f (diff) | |
download | FreeBSD-src-c94209caab986a73c2087101018e42d24c60b3e4.zip FreeBSD-src-c94209caab986a73c2087101018e42d24c60b3e4.tar.gz |
Document conditions for IP_SENDSRCADDR socket option.
Obtained from: r167342 commit message
Diffstat (limited to 'share/man')
-rw-r--r-- | share/man/man4/ip.4 | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/share/man/man4/ip.4 b/share/man/man4/ip.4 index d921c15f..e213711 100644 --- a/share/man/man4/ip.4 +++ b/share/man/man4/ip.4 @@ -32,7 +32,7 @@ .\" @(#)ip.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" -.Dd June 15, 2012 +.Dd September 12, 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,22 @@ cmsg_level = IPPROTO_IP cmsg_type = IP_SENDSRCADDR .Ed .Pp +The socket should be bound to a local port. +The socket may be bound or not bound to a local address. +In the former case address supplied with +.Dv IP_SENDSRCADDR +overrides bound address. +If the socket is bound to a local address and the address supplied with +.Dv IP_SENDSRCADDR +is +.Dv INADDR_ANY , +then bound address is overriden via generic source address selection logic, +which would choose IP address of interface closest to destination. +If the socket is not bound to a local address, then address supplied with +.Dv IP_SENDSRCADDR +can't be +.Dv INADDR_ANY . +.Pp For convenience, .Dv IP_SENDSRCADDR is defined to have the same value as |