Support IPv6 connections

This commit enables support for IPv6 connections. As a result of the
approach the format of log output changes: IPv4 addresses will now be
logged as "::ffff:w.x.y.z".