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.