Fixes #2478: IPv6 support backported for 2.1.x