On 09/16/2013 02:25 AM, Sebastian Ottlik wrote: > SO_REUSEADDR should be avoided on Windows but is desired on other operating > systems. So instead of setting it we call socket_set_fast_reuse that will > result > in the appropriate behaviour on all operating systems. > > An exception to this rule are multicast sockets where it is sensible to have > multiple sockets listen on the same ip and port and we should set SO_REUSEADDR > on windows. >
> /* allow fast reuse */ > - val = 1; > - qemu_setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val)); > + socket_set_fast_reuse(fd, false); Changed from silent to noisy. Intentional? > @@ -661,11 +665,9 @@ static int net_socket_udp_init(NetClientState *peer, > perror("socket(PF_INET, SOCK_DGRAM)"); > return -1; > } > - val = 1; > - ret = qemu_setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, > - &val, sizeof(val)); > + > + ret = socket_set_fast_reuse(fd, true); > if (ret < 0) { > - perror("setsockopt(SOL_SOCKET, SO_REUSEADDR)"); > closesocket(fd); > return -1; Changed from noisy to silent. Intentional? -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature