how to handle both ipv4 and ipv6 in libipq
A message that is not in the archive (sent off-list or not yet received): [email protected]
Dear all,
I want use lipipq to capture ipv4 and ipv6 packets by libipq, but the libipq is only support one. So I modify the following:
- add 2 fd sockets in ipq_handle to support ipv4 (NETLINK_FIREWALL) and ipv6 (NETLINK_IP6_FW)
- In ipq_create_handle(), create both 2 sockets and binding them.
- in ipq_netlink_recvfrom() select on 2 fds, if have packet comming, then process at proper file descriptor. the current fd will be keep in structure to support for ipq_set_verdict()
I write the program to capture and display info of packets receiving, it run ok both ipv4/ipv6 packets.
But, in some cases, I want when to get a ipv4 packet I need reinject a ipv6 packet (instead of ipv4 packet). If I use verdict to put ipv6 packet to kernel at ipv4 queue, then it is not go through more, may it is drop because in-proper queue
I am newbie for make target in netfilter, so I woud like to know how-to reinject a ipv6 to queue6 when I am standing ipv4 queue?
or what's mechanism in netfilter can help me to do following:
- capture all ipv4/ipv6
- reinject any type of packet (ipv6/ipv4)
I appreciate your help.
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail