0

I have been trying to find an answer for this but I'm getting desperate now as I'm not able to find any reliable source or reference documentation.

What I'm trying to do is, send an ipv6 packet to a client with HopbyHop extension header attached to it using the Advanced APIs RFC 3542

The option type of HopbyHop extension header is say, OPT_X which is user-defined. Now, when I send the packet to the receiver, the packet is not displayed at the receiving side. But it shows that I have received a correct packet with Wireshark at the interface.

I'm using raw sockets to do the above communication.

socket(AF_INET6, SOCk_RAW, IPPROTO_RAW)

In my IPv6 header I define the value for the next header as 0 (which is for HopbyHop extension header)

For sending and receiving the packets I use sendmsg() and recvmsg() system calls, which seem to be working correctly for the following scenario,

When I have my nextHeader values as 255, the receiver prints it successfully,

But If I have the nextHeader value as 0, the receiver does not seem to receive it because it processes the Option Type value in the header for which it does not have any implementation in the kernel.

For option type which is what I have defined 'OPT_X' it send me an ICMP error saying, Parameter not recognized. But If I change that to value which is implemented by the kernel, like 'Router Alert' or 'Jumbo Frame' it does not give the ICMP error.

Is there a way, using any socket options or filter to tell the kernel to not process the option type for the hop by hop extension header, because I want to be able to do all that in the user-space.

Any help or references for the same will be of great help. I have been trying to solve this quite some time now, but with no success.

Community
  • 1
  • 1
Akshay
  • 329
  • 1
  • 7
  • 19
  • It's not going to work. See http://stackoverflow.com/questions/9847923/processing-packets-with-unknown-ipv6-extension-headers - everything along the route needs to understand the header – Anya Shenanigans Apr 08 '14 at 08:19
  • I know that, if the option is not recognized it would send me an ICMP error..but Is there a way that one can specify it's own custom option type in the extension header for testing purpose...or the only way to do this is by handling it as a LKM – Akshay Apr 08 '14 at 09:21
  • I guess there should be a way to tell the kernel to not process the the extension header option type...as it would be handled in the user space. There should be some setsockopt() option which would allow us to do so I guess... – Akshay Apr 08 '14 at 09:23

0 Answers0