summaryrefslogtreecommitdiffstats
path: root/avahi-core/socket.c
diff options
context:
space:
mode:
authorSebastien Estienne <sebastien.estienne@gmail.com>2005-11-09 17:36:00 +0000
committerSebastien Estienne <sebastien.estienne@gmail.com>2005-11-09 17:36:00 +0000
commitd231420ce0a5b36587b7b16aa56f1d48e06f62d7 (patch)
tree217abc84ed8a9d665b1c2bcc6b8756176f8e4365 /avahi-core/socket.c
parent114645560ccb137345760502cff17bf26257a09e (diff)
* set IP_MULTICAST_IF for *BSD
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@943 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-core/socket.c')
-rw-r--r--avahi-core/socket.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/avahi-core/socket.c b/avahi-core/socket.c
index e3e394a..a84a3d9 100644
--- a/avahi-core/socket.c
+++ b/avahi-core/socket.c
@@ -503,10 +503,13 @@ int avahi_send_dns_packet_ipv4(int fd, AvahiIfIndex interface, AvahiDnsPacket *p
msg.msg_control = cmsg_data;
msg.msg_controllen = sizeof(cmsg_data);
}
-#else
-#ifdef __GNUC__
-#warning "FIXME: We need some code to set the outgoing interface/local address here if IP_PKTINFO is not available"
-#endif
+#elif defined(IP_MULTICAST_IF)
+ if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF, &(src_address->address), sizeof(src_address->address)) < 0) {
+ avahi_log_warn("IP_MULTICAST_IF failed: %s", strerror(errno));
+ return -1;
+ }
+#elif defined(__GNUC__)
+#warning "FIXME: We need some code to set the outgoing interface/local address here if IP_PKTINFO/IP_MULTICAST_IF is not available"
#endif
return sendmsg_loop(fd, &msg, 0);