Skip to contentSkip to conversation

question regarding (AF_INET6, SOCK_RAW, IPPROTO_RAW) sockets

DISCUSSION Octavian Purdila 2 participants 3 messages Mar 12, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

I've noticed that when using IPv6 raw sockets with IPPROTO_RAW protocol and IPV6_PKTINFO set, we are not allow to specify a source address that it is not configured in the system.

Disabling ipv6_chk_addr in datagram_send_ctl for IPv6 raw sockets seems to fix our problem. Is this approach the right one?

Thanks,
tavi

#1 lore raw

Le Wednesday 12 March 2008 18:34:29 Octavian Purdila, vous avez écrit :

Quoted 8 lines

Hi,

I've noticed that when using IPv6 raw sockets with IPPROTO_RAW protocol and IPV6_PKTINFO set, we are not allow to specify a source address that it is not configured in the system.

Disabling ipv6_chk_addr in datagram_send_ctl for IPv6 raw sockets seems to fix our problem. Is this approach the right one?

I am a bit confused here. Why would you use IPV6_PKTINFO with a network-layer raw socket? You have to write the IPv6 header anyway, so what useful additional infos would you the ancillary data contain?

Signature · 1 line
Rémi Denis-Courmont
#2 lore raw
Quoted 4 lines · Rémi Denis-Courmont

I am a bit confused here. Why would you use IPV6_PKTINFO with a network-layer raw socket? You have to write the IPv6 header anyway, so what useful additional infos would you the ancillary data contain?

Hi Rémi,

You are right. For some reason (the IPV4 case / man 7 raw) I though that IPV6_PKTINFO is implied when using IPPROTO_RAW but I see now that it is not required.

Thanks,
tavi