lkml.org 
[lkml]   [2003]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: sendmsg and IP_PKTINFO
On Tuesday February 18, ja@ssi.bg wrote:
>
> Hello,
>
> Neil Brown wrote:
>
> > Note that the in_pktinfo is described as "some information about the
> > incoming packet". In particular ipi_ifindex is "the unique index of
> > the interface the packets was received on".
> >
> > i.e. it is more about the incoming than the outgoing packet.
>
> Yes, because when set as socket option you can receive
> pktinfo with recvmsg. But IP_PKTINFO can be used also with sendmsg.
> Just forget about interfaces, i.e. use something like this in cmsg:
>
> .ipi = {
> .ipi_ifindex = 0,
> .ipi_spec_dst = local_ip,
> },
>

Certainly IP_PKTINFO can be used with sendmsg. The doesn't change the
fact that the documentation clearly says that the information is
information about an incoming packet.

Also, th only documentation I can find does not specify that a value
of 0 means "no specific interface is selected". So while I can see
from the code that what you suggest would work in practice, it would
be nice if this were clearly documented somewhere.

NeilBrown

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:33    [W:0.037 / U:4.632 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site