summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authormarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2006-04-25 05:16:50 +0800
committermarcus <marcus@df743ca5-7f9a-e211-a948-0013205c9059>2006-04-25 05:16:50 +0800
commit7de993debda68d126f9555fd1b46b6da4b4c9341 (patch)
treea25bbb14f973cb9583493bb25c6c1ce1eb288be7 /net
parent1c88c358ab1f7b5ede27f7e5ba1e9028f4c33c54 (diff)
downloadmarcuscom-ports-7de993debda68d126f9555fd1b46b6da4b4c9341.tar
marcuscom-ports-7de993debda68d126f9555fd1b46b6da4b4c9341.tar.gz
marcuscom-ports-7de993debda68d126f9555fd1b46b6da4b4c9341.tar.bz2
marcuscom-ports-7de993debda68d126f9555fd1b46b6da4b4c9341.tar.lz
marcuscom-ports-7de993debda68d126f9555fd1b46b6da4b4c9341.tar.xz
marcuscom-ports-7de993debda68d126f9555fd1b46b6da4b4c9341.tar.zst
marcuscom-ports-7de993debda68d126f9555fd1b46b6da4b4c9341.zip
Retool this patch a bit to keep it more in the spirit of the original code.
git-svn-id: svn://creme-brulee.marcuscom.com/ports/trunk@6125 df743ca5-7f9a-e211-a948-0013205c9059
Diffstat (limited to 'net')
-rw-r--r--net/avahi/files/patch-avahi-core_socket.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/net/avahi/files/patch-avahi-core_socket.c b/net/avahi/files/patch-avahi-core_socket.c
index 783d41c02..dc19ed379 100644
--- a/net/avahi/files/patch-avahi-core_socket.c
+++ b/net/avahi/files/patch-avahi-core_socket.c
@@ -1,38 +1,28 @@
---- avahi-core/socket.c.orig Sun Apr 23 19:20:31 2006
-+++ avahi-core/socket.c Sun Apr 23 20:16:46 2006
+--- avahi-core/socket.c.orig Thu Feb 9 20:45:09 2006
++++ avahi-core/socket.c Mon Apr 24 17:14:18 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))];
++ uint8_t 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
+@@ -518,18 +518,17 @@ int avahi_send_dns_packet_ipv4(int fd, A
#elif defined(IP_SENDSRCADDR)
if (src_address) {
struct in_addr *addr;
+
++ 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 in_addr));
+ 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;
@@ -42,30 +32,30 @@
}
#elif defined(IP_MULTICAST_IF)
{
-@@ -551,7 +548,7 @@ int avahi_send_dns_packet_ipv6(int fd, A
+@@ -551,7 +550,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))];
++ uint8_t 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
+@@ -576,9 +575,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);
++ 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
+@@ -591,8 +592,6 @@ int avahi_send_dns_packet_ipv6(int fd, A
if (src_address)
memcpy(&pkti->ipi6_addr, src_address->address, sizeof(src_address->address));