Clean up localhost resolv logic and add IPv6 support to regexp Upstream-commit: e9d3e237e5cffef0dfcd4949c31959cd25863f3f Component: engine