fixes #550
split up the if/else so that both ipv4 and ipv6 tests can run without
returning immediately. this allows a single field to accept either type.