From b155147d7095ee71ac3872f11d42227483d9ecce Mon Sep 17 00:00:00 2001 From: Sebastien Estienne Date: Fri, 17 Mar 2006 11:38:36 +0000 Subject: [PATCH] Patch from sjoerd simons to close Ticket #19 (Doesn't work on 64 bit machines with 32 bit userspace) git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1178 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- avahi-core/socket.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/avahi-core/socket.c b/avahi-core/socket.c index 82622d3..453ce54 100644 --- a/avahi-core/socket.c +++ b/avahi-core/socket.c @@ -513,7 +513,7 @@ int avahi_send_dns_packet_ipv4(int fd, AvahiIfIndex interface, AvahiDnsPacket *p pkti->ipi_spec_dst.s_addr = src_address->address; msg.msg_control = cmsg_data; - msg.msg_controllen = sizeof(cmsg_data); + msg.msg_controllen = CMSG_SPACE(sizeof(struct in_pktinfo)); } #elif defined(IP_SENDSRCADDR) if (src_address) { @@ -529,7 +529,7 @@ int avahi_send_dns_packet_ipv4(int fd, AvahiIfIndex interface, AvahiDnsPacket *p addr->s_addr = src_address->address; msg.msg_control = cmsg_data; - msg.msg_controllen = sizeof(cmsg_data); + msg.msg_controllen = CMSG_SPACE(sizeof(struct in_addr)); } #elif defined(IP_MULTICAST_IF) { @@ -592,7 +592,7 @@ int avahi_send_dns_packet_ipv6(int fd, AvahiIfIndex interface, AvahiDnsPacket *p memcpy(&pkti->ipi6_addr, src_address->address, sizeof(src_address->address)); msg.msg_control = cmsg_data; - msg.msg_controllen = sizeof(cmsg_data); + msg.msg_controllen = CMSG_SPACE(sizeof(struct in6_pktinfo)); } else { msg.msg_control = NULL; msg.msg_controllen = 0; -- 2.39.5