Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1537758

IPV6_PKTINFO socket option

From Renata Saiakhova <Renata.Saiakhova@oneaccess-net.com>
Newsgroups linux.kernel
Subject IPV6_PKTINFO socket option
Date 2016-12-07 14:50 +0100
Message-ID <sLKLD-Il-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Hi all,

I would like to use IPV6_PKTINFO option to specify an outgoing IPv6 
address in sendmsg(). The socket is not bound neither to an address nor 
to an interface. Should I always specify ifindex together with source 
address?

(according to rfc3542 :

The kernel must verify that the requested source address is indeed a 
unicast address assigned to the node. When the address is a scoped one, 
there may be ambiguity about its scope zone. This is particularly the 
case for link-local addresses. In such a case, the kernel must first 
determine the appropriate scope zone based on the zone of the 
destination address or the outgoing interface (if known), then qualify 
the address. This also means that it is not feasible to specify the 
source address for a non-binding socket by the IPV6_PKTINFO sticky 
option, unless the outgoing interface is also specified. The application 
should simply use bind() for such purposes. )

It looks somewhat ambiguous, for me it is not clear, should ifindex be 
always specified, suppose, for global addresses?

I looked at linux kernel implementation as a reference, and it seems 
that this sticky option information is stored in ipv6_pinfo structure, 
but only ipi6_ifindex is used while constructing i6 flow in 
udpv6_sendmsg. ipi6_addr part is used only in getsockopt to return this 
information. Why ipi6_addr is not used in constructing i6 flow?

Kind regards,

Renata

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

IPV6_PKTINFO socket option Renata Saiakhova <Renata.Saiakhova@oneaccess-net.com> - 2016-12-07 14:50 +0100

csiph-web