summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authormarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2006-04-24 08:21:37 +0800
committermarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2006-04-24 08:21:37 +0800
commit713863990b1d893a12faf8cf786d60dbbc62b5ad (patch)
treeb08b2e8fce86614e35c5c2b77cb707946ee6c8fa /net
parent53771ed253e5272e19cf49eb9afeaab7e4a8701e (diff)
downloadmarcuscom-ports-713863990b1d893a12faf8cf786d60dbbc62b5ad.tar
marcuscom-ports-713863990b1d893a12faf8cf786d60dbbc62b5ad.tar.gz
marcuscom-ports-713863990b1d893a12faf8cf786d60dbbc62b5ad.tar.bz2
marcuscom-ports-713863990b1d893a12faf8cf786d60dbbc62b5ad.tar.lz
marcuscom-ports-713863990b1d893a12faf8cf786d60dbbc62b5ad.tar.xz
marcuscom-ports-713863990b1d893a12faf8cf786d60dbbc62b5ad.tar.zst
marcuscom-ports-713863990b1d893a12faf8cf786d60dbbc62b5ad.zip
Fix sendmsg so that avahi actually works.
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@6116 df743ca5-7f9a-e211-a948-0013205c9059
Diffstat (limited to 'net')
-rw-r--r--net/avahi/Makefile4
-rw-r--r--net/avahi/files/patch-avahi-core_socket.c76
2 files changed, 78 insertions, 2 deletions
diff --git a/net/avahi/Makefile b/net/avahi/Makefile
index aa4d97e25..37ba73654 100644
--- a/net/avahi/Makefile
+++ b/net/avahi/Makefile
@@ -3,11 +3,11 @@
# Whom: Joe Marcus Clarke <marcus@FreeBSD.org>
#
# $FreeBSD$
-# $MCom: ports/net/avahi/Makefile,v 1.12 2006/03/13 01:40:06 marcus Exp $
+# $MCom: ports/net/avahi/Makefile,v 1.13 2006/04/20 18:12:14 marcus Exp $
PORTNAME= avahi
PORTVERSION= 0.6.9
-PORTREVISION?= 2
+PORTREVISION?= 3
CATEGORIES?= net dns
MASTER_SITES= http://www.avahi.org/download/
diff --git a/net/avahi/files/patch-avahi-core_socket.c b/net/avahi/files/patch-avahi-core_socket.c
new file mode 100644
index 000000000..783d41c02
--- /dev/null
+++ b/net/avahi/files/patch-avahi-core_socket.c
@@ -0,0 +1,76 @@
+--- avahi-core/socket.c.orig Sun Apr 23 19:20:31 2006
++++ avahi-core/socket.c Sun Apr 23 20:16:46 2006
+@@ -468,7 +468,7 @@ int avahi_send_dns_packet_ipv4(int fd, A
+ size_t cmsg_data[( CMSG_SPACE(sizeof(struct in_pktinfo)) / sizeof(size_t)) + 1];
+ #elif defined(IP_SENDSRCADDR)
+ struct cmsghdr *cmsg;
+- size_t cmsg_data[( CMSG_SPACE(sizeof(struct in_addr)) / sizeof(size_t)) + 1];
++ char cmsg_data[CMSG_SPACE(sizeof(struct in_addr))];
+ #endif
+
+ assert(fd >= 0);
+@@ -491,8 +491,8 @@ int avahi_send_dns_packet_ipv4(int fd, A
+ msg.msg_iov = &io;
+ msg.msg_iovlen = 1;
+ msg.msg_flags = 0;
+- msg.msg_control = NULL;
+- msg.msg_controllen = 0;
++ msg.msg_control = cmsg_data;
++ msg.msg_controllen = sizeof(cmsg_data);
+
+ #ifdef IP_PKTINFO
+ if (interface > 0 || src_address) {
+@@ -518,18 +518,15 @@ int avahi_send_dns_packet_ipv4(int fd, A
+ #elif defined(IP_SENDSRCADDR)
+ if (src_address) {
+ struct in_addr *addr;
++
++ cmsg = CMSG_FIRSTHDR(&msg);
+
+- memset(cmsg_data, 0, sizeof(cmsg_data));
+- cmsg = (struct cmsghdr*) cmsg_data;
+- cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr));
+ cmsg->cmsg_level = IPPROTO_IP;
+ cmsg->cmsg_type = IP_SENDSRCADDR;
++ cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr));
+
+ addr = (struct in_addr *)CMSG_DATA(cmsg);
+ addr->s_addr = src_address->address;
+-
+- msg.msg_control = cmsg_data;
+- msg.msg_controllen = sizeof(cmsg_data);
+ }
+ #elif defined(IP_MULTICAST_IF)
+ {
+@@ -551,7 +548,7 @@ int avahi_send_dns_packet_ipv6(int fd, A
+ struct msghdr msg;
+ struct iovec io;
+ struct cmsghdr *cmsg;
+- size_t cmsg_data[(CMSG_SPACE(sizeof(struct in6_pktinfo))/sizeof(size_t)) + 1];
++ char cmsg_data[CMSG_SPACE(sizeof(struct in6_pktinfo))];
+
+ assert(fd >= 0);
+ assert(p);
+@@ -576,9 +573,11 @@ int avahi_send_dns_packet_ipv6(int fd, A
+
+ if (interface > 0 || src_address) {
+ struct in6_pktinfo *pkti;
++
++ msg.msg_control = cmsg_data;
++ msg.msg_controllen = sizeof(cmsg_data);
++ cmsg = CMSG_FIRSTHDR(&msg);
+
+- memset(cmsg_data, 0, sizeof(cmsg_data));
+- cmsg = (struct cmsghdr*) cmsg_data;
+ cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo));
+ cmsg->cmsg_level = IPPROTO_IPV6;
+ cmsg->cmsg_type = IPV6_PKTINFO;
+@@ -591,8 +590,6 @@ int avahi_send_dns_packet_ipv6(int fd, A
+ if (src_address)
+ memcpy(&pkti->ipi6_addr, src_address->address, sizeof(src_address->address));
+
+- msg.msg_control = cmsg_data;
+- msg.msg_controllen = sizeof(cmsg_data);
+ } else {
+ msg.msg_control = NULL;
+ msg.msg_controllen = 0;