[sr-dev] git:4.0: core: try to detect ipv6 addresses only when USE_IPV6 is used