test: check ipv6 support before testing it

fix #7983
fix #8049
Oh, right. it should be 4 and 3...