]> git.meshlink.io Git - catta/commitdiff
Patch from sjoerd simons to close Ticket #19 (Doesn't work on 64 bit machines with...
authorSebastien Estienne <sebastien.estienne@gmail.com>
Fri, 17 Mar 2006 11:38:36 +0000 (11:38 +0000)
committerSebastien Estienne <sebastien.estienne@gmail.com>
Fri, 17 Mar 2006 11:38:36 +0000 (11:38 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1178 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-core/socket.c

index 82622d3bd0ffed5f6c7a64000af6908459b92386..453ce54d996f0a0d5c5579eebaa7e38a91e1e373 100644 (file)
@@ -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;