Changes to support IPv6 from Thomas Dreibholz