openbsd-ports/emulators/qemu/patches/patch-net_socket_c
2011-03-12 23:28:39 +00:00

24 lines
945 B
Plaintext

$OpenBSD: patch-net_socket_c,v 1.2 2011/03/12 23:28:39 sthen Exp $
--- net/socket.c.orig Mon Feb 14 17:02:07 2011
+++ net/socket.c Tue Feb 15 20:40:23 2011
@@ -154,6 +154,7 @@ static int net_socket_mcast_create(struct sockaddr_in
struct ip_mreq imr;
int fd;
int val, ret;
+ u_char loop;
if (!IN_MULTICAST(ntohl(mcastaddr->sin_addr.s_addr))) {
fprintf(stderr, "qemu: error: specified mcastaddr \"%s\" (0x%08x) does not contain a multicast address\n",
inet_ntoa(mcastaddr->sin_addr),
@@ -197,9 +198,9 @@ static int net_socket_mcast_create(struct sockaddr_in
}
/* Force mcast msgs to loopback (eg. several QEMUs in same host */
- val = 1;
+ loop = 1;
ret=setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP,
- (const char *)&val, sizeof(val));
+ (const char *)&loop, sizeof(loop));
if (ret < 0) {
perror("setsockopt(SOL_IP, IP_MULTICAST_LOOP)");
goto fail;