question regarding (AF_INET6, SOCK_RAW, x != IPPROTO_RAW) sockets
Subsystems (2)
Hi,
In a previous post I was asking about the ipv6_chk_addr check done in datagram_send_ctl when using raw sockets with IPROTO_RAW. Remi pointed out that this case is not relevant since we need to construct the IPv6 header anyway.
What about when using IPV6 raw sockets with protocol != IPPROTO_RAW? In this case, it seems that the header is constructed by the networking stack, and if we want to change the source address we need to use IPV6_PKTINFO.
But datagram_send_ctl is checking in ipv6_chk_addr for the source address to be a previously assigned address in the system. Is this check necessary for IPv6 raw sockets? The same check does not seem to be present for IPv4. Also, disabling ipv6_chk_addr in datagram_send_ctl for IPv6 raw sockets seems to fix our problem. But is this approach the right one?
Thanks,
tavi