Fixes for ipv6.

Original Author: Matthias Scheler <tron@netbsd.org> and others
Description: Fix various IPv6-related typos, C&P bugs etc.
These can crash applications using libspf2 or give the wrong result
if an e-mail gets delivered via SMTP over IPv6 depending on the remote
machine's IPv6 address.