This supports the v4-mapped range ::ffff:0.0.0.0/96, and the deprecated
v4-compatible range ::0.0.0.0/96 (with an exception for ::0/112 so that
the magic addresses ::1 and :: still comes out OK). The output
behaviour here seems to match Linux's inet_ntop(3).