diff --git a/gtests/net/packetdrill/run_system_call.c b/gtests/net/packetdrill/run_system_call.c index 1ec42605b3162431df215656133c05f7d5ccdfad..1e55e4c06d724aff35d107144621381a4bf36ed5 100644 --- a/gtests/net/packetdrill/run_system_call.c +++ b/gtests/net/packetdrill/run_system_call.c @@ -1996,7 +1996,14 @@ static int syscall_socket(struct state *state, struct syscall_spec *syscall, return STATUS_ERR; if (result >= 0) { + const int off = 0; + live_fd = result; + /* If IPv4-mapped IPv6 addresses are used, disable IPV6_V6ONLY */ + if (state->config->socket_domain == AF_INET6 && + state->config->wire_protocol == AF_INET) { + setsockopt(live_fd, IPPROTO_IPV6, IPV6_V6ONLY, &off, sizeof(int)); + } if (get_s32(syscall->result, &script_fd, error)) return STATUS_ERR; if (run_syscall_socket(state, domain, protocol,