Skip to contentSkip to conversation

IPV6_PKTINFO socket option

DISCUSSION Gerrit Renker 2 participants 2 messages Aug 8, 2007

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

Yoshifuji-san,

a few weeks earlier I enquired about the IPV6_PKTINFO socket option to get at the destination address of datagrams, where you replied that this option is `deprecated'.

There are three problems:

1. On i386 it works as described in section 4 of RFC 3542, using IPV6_RECVPKTINFO as sticky socket option to pull out the IPV6_PKTINFO cmsg header fields.

2. On sparc64 with the same kernel IPV6_PKTINFO works without problems, even pulls out the cmsg fields correctly. Conversely, when trying to set the IPV6_RECVPKTINFO sticky option on the socket, no cmsg fields are generated.
The kernel is of the same date and revision as the i386 kernel - library issue ??? It is very annoying, since the application needs to run on both architectures.

3. Misc:
* The option is mentioned 9 times in the index of "Unix Network Programming" (3rd ed., p. 969). Moreover, an entire section (27.7) is devoted to this topic.
* It might be good to give at least a warning message in the syslog that the IPV6_PKTINFO socket option is no longer supported. That would save many users grief. An example how this was done in DCCP is in net/dccp/proto.c:

case DCCP_SOCKOPT_PACKET_SIZE:
DCCP_WARN("sockopt(PACKET_SIZE) is deprecated: fix your app");

Maybe this is due to a misunderstanding - in which case I'd be grateful for any clarifications.

Thanks
Gerrit

maintainer
#1 lore raw

From: Gerrit Renker <[email protected]>
Date: Wed, 8 Aug 2007 12:16:51 +0100

Quoted 5 lines

2. On sparc64 with the same kernel IPV6_PKTINFO works without problems, even pulls out the cmsg fields correctly. Conversely, when trying to set the IPV6_RECVPKTINFO sticky option on the socket, no cmsg fields are generated.
The kernel is of the same date and revision as the i386 kernel - library issue ??? It is very annoying, since the application needs to run on both architectures.

Almost certainly a compat layer bug in the kernel, it would affect 32-bit applications on powerpc64 and similar if so.