Re: sendmsg and IP_PKTINFO

From: Andi Kleen (ak@suse.de)
Date: Wed Feb 19 2003 - 03:17:58 EST


"David S. Miller" <davem@redhat.com> writes:

> All you are showing us Neil is that the documentation
> is inaccurate. That snippet you showed me from manual
> pages is wrong about sendmsg semantics.

Yes, it's wrong I agree. Here is a patch. Please check
and if nobody complains Andries can apply.

>
> The ifindex you specify does mean "send out this interface".
>
> It is very surprising that this documentation is wrong since
> the likely author (Andi Kleen) is smart enough to read the
> actual implementation when he writes these things.

There was no serious technical review of these manpages ever, so
I wouldn't be surprised if there are more such technical errors (hint ;)

-Andi

--- ip.7~ 2003-02-19 08:50:48.000000000 +0100
+++ ip.7 2003-02-19 09:09:36.000000000 +0100
@@ -260,12 +260,16 @@
 .I IP_PKTINFO
 is passed to
 .BR sendmsg (2)
-then the outgoing packet will be sent over the interface
-specified in
-.B ipi_ifindex
-with the destination address set to
+and
+.\" This field is grossly misnamed
 .B ipi_spec_dst
-.
+is not zero then it is used as the local source address for the routing
+table lookup and for setting up IP source route options.
+When
+.B ipi_ifindex
+is not zero the primary local address of the interface specified by the index overwrites
+.I ipi_spec_dst
+for the routing table lookup.
 
 .TP
 .B IP_RECVTOS

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Feb 23 2003 - 22:00:25 EST