I have an NFQUEUE, for IPv6 packets hooked to PREROUTING chain of mangle table in ip6tables. Once I receive a packet in user application, I modified the header. Infact, modified the header from IPv6 to IPv4 and reinjected the packet. But, from the logs, I see that the IPv4 packet is being treated like an IPv6 packet.
Since each NFQUEUE is mapped to either AF_INET or AF_INET6, is it possible for a single NFQUEUE to handle both IPv4 and IPv6 packets?
Is it possible to receive the packet from one queue but inject in a different queue? It doesn't make sense but I would like to inject a packet to the IP stack directly with the IP header formatted in userspace.
- It is not advisable to use raw sockets with IPv6 as per RFC 3542.
- I am not able to use TUN device for performance issues. Lot of packets are being dropped with TUN devices.