Bah, it's always the way, 2 minutes after testing and then mailing a patch I realise there's a small slip-up. Patch without the stupid-obvious-bug attached :)
Heh.
I just committed a variant of your patch. I had to add some things to get it to compile on Darwin.
Please let me know how that works for you. I know it compiles on Linux, but the Linux box I have partial access to doesn't have IPv6 configured.
Thanks! -- justin