MavEtJu's Distorted View of the World
FreeBSD IPv6 Divert socket adventures
Posted on 2008-05-06 10:00:00
Tags: IPv6, FreeBSD, Networking
This whole IPv6 Divert idea seems to be a little bit optimistic
now. As all new technology (I wouldn't call IPv6 new technology,
but still) not everything you have available now is supported in
So, how far did we get?
- FreeBSD's ipfw2 supports diverting of IPv6 packets. Yay!
A simple program which listens on the divert socket (IPPROTO_DIVERT)
for IPv4 (PF_INET) and prints some information about the packets
received works. Yay!
That same program for IPv6 (PF_INET6) doesn't work, lsof says that
it is listening for protocol 0 (the catch all) instead of protocol
Looking through ip_divert() in src/netinet/ip_divert.c
shows about the registration of protocols (thanks to bms@ for hints):
pf_proto_register(PF_INET, &div_protosw), but when I do
this for PF_INET6 it returns an error which is related to the absence
of a free IPPROTO_SPACER. And these are (thanks to rwatson@ for
hints) not available for IPv6.
So, this is getting trickier and trickier for an userland guy like
me to experiment with on a sunday afternoon... But I'm not going
to give up! (yet)
On the other hand, an interesting paper by Dr. Goto (I'm not kidding)
and friends available at IPV4/V6
NETWORK EMULATOR USING DIVERT SOCKET says:
We have ported divert socket to IPv6 by adding about 1000
lines of C program code either on FreeBSD and Linux kernel
for this research.
I have asked him if he wanted to share his code but haven't heard
anything back from him.
| Share on Facebook
| Share on Twitter
No comments yet
Leave a comment
Back to the main page