From f718bc4833b996000f19b6d5d168d7974b2bd6d4 Mon Sep 17 00:00:00 2001 From: Sven Wegener Date: Sun, 7 Jan 2007 14:15:22 +0000 Subject: [PATCH] Revision bump, pull in a couple of fixes until 0.6.17 is released. Package-Manager: portage-2.1.2_rc4-r6 --- net-dns/avahi/ChangeLog | 15 +- net-dns/avahi/avahi-0.6.16-r1.ebuild | 179 ++++++++++++ .../avahi/files/avahi-0.6.16-svn-1353.patch | 13 + .../avahi/files/avahi-0.6.16-svn-1361.patch | 56 ++++ .../avahi/files/avahi-0.6.16-svn-1363.patch | 26 ++ .../avahi/files/avahi-0.6.16-svn-1365.patch | 258 ++++++++++++++++++ .../avahi/files/avahi-0.6.16-svn-1366.patch | 96 +++++++ .../avahi/files/avahi-0.6.16-svn-1370.patch | 106 +++++++ .../avahi/files/avahi-0.6.16-svn-1371.patch | 15 + .../avahi/files/avahi-0.6.16-svn-1372.patch | 22 ++ .../avahi/files/avahi-0.6.16-svn-1374.patch | 105 +++++++ net-dns/avahi/files/digest-avahi-0.6.16-r1 | 3 + 12 files changed, 892 insertions(+), 2 deletions(-) create mode 100644 net-dns/avahi/avahi-0.6.16-r1.ebuild create mode 100644 net-dns/avahi/files/avahi-0.6.16-svn-1353.patch create mode 100644 net-dns/avahi/files/avahi-0.6.16-svn-1361.patch create mode 100644 net-dns/avahi/files/avahi-0.6.16-svn-1363.patch create mode 100644 net-dns/avahi/files/avahi-0.6.16-svn-1365.patch create mode 100644 net-dns/avahi/files/avahi-0.6.16-svn-1366.patch create mode 100644 net-dns/avahi/files/avahi-0.6.16-svn-1370.patch create mode 100644 net-dns/avahi/files/avahi-0.6.16-svn-1371.patch create mode 100644 net-dns/avahi/files/avahi-0.6.16-svn-1372.patch create mode 100644 net-dns/avahi/files/avahi-0.6.16-svn-1374.patch create mode 100644 net-dns/avahi/files/digest-avahi-0.6.16-r1 diff --git a/net-dns/avahi/ChangeLog b/net-dns/avahi/ChangeLog index 28e2ba419058..625c1c2da494 100644 --- a/net-dns/avahi/ChangeLog +++ b/net-dns/avahi/ChangeLog @@ -1,6 +1,17 @@ # ChangeLog for net-dns/avahi -# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-dns/avahi/ChangeLog,v 1.83 2006/12/29 13:13:43 dertobi123 Exp $ +# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-dns/avahi/ChangeLog,v 1.84 2007/01/07 14:15:22 swegener Exp $ + +*avahi-0.6.16-r1 (07 Jan 2007) + + 07 Jan 2007; Sven Wegener + +files/avahi-0.6.16-svn-1353.patch, +files/avahi-0.6.16-svn-1361.patch, + +files/avahi-0.6.16-svn-1363.patch, +files/avahi-0.6.16-svn-1365.patch, + +files/avahi-0.6.16-svn-1366.patch, +files/avahi-0.6.16-svn-1370.patch, + +files/avahi-0.6.16-svn-1371.patch, +files/avahi-0.6.16-svn-1372.patch, + +files/avahi-0.6.16-svn-1374.patch, -avahi-0.6.16.ebuild, + +avahi-0.6.16-r1.ebuild: + Revision bump, pull in a couple of fixes until 0.6.17 is released. *avahi-0.6.16 (29 Dec 2006) diff --git a/net-dns/avahi/avahi-0.6.16-r1.ebuild b/net-dns/avahi/avahi-0.6.16-r1.ebuild new file mode 100644 index 000000000000..64e6fd6b35ed --- /dev/null +++ b/net-dns/avahi/avahi-0.6.16-r1.ebuild @@ -0,0 +1,179 @@ +# Copyright 2000-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dns/avahi/avahi-0.6.16-r1.ebuild,v 1.1 2007/01/07 14:15:22 swegener Exp $ + +inherit eutils mono python qt3 qt4 + +DESCRIPTION="System which facilitates service discovery on a local network" +HOMEPAGE="http://avahi.org/" +SRC_URI="http://avahi.org/download/${P}.tar.gz + http://lathiat.net/${P}.tar.gz" + +LICENSE="LGPL-2.1" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd" +IUSE="bookmarks howl-compat mdnsresponder-compat gdbm dbus doc mono gtk python qt3 qt4 autoipd" + +RDEPEND=">=dev-libs/libdaemon-0.5 + dev-libs/expat + >=dev-libs/glib-2 + gdbm? ( sys-libs/gdbm ) + qt3? ( $(qt_min_version 3.3.6-r2) ) + qt4? ( $(qt4_min_version 4) ) + gtk? ( + >=x11-libs/gtk+-2 + >=gnome-base/libglade-2 + ) + dbus? ( + >=sys-apps/dbus-0.30 + python? ( + || ( + dev-python/dbus-python + ( + =sys-apps/dbus-0.30 + ) + ) + ) + ) + mono? ( >=dev-lang/mono-1.1.10 ) + howl-compat? ( !net-misc/howl ) + mdnsresponder-compat? ( !net-misc/mDNSResponder ) + python? ( + >=virtual/python-2.4 + gtk? ( >=dev-python/pygtk-2 ) + ) + bookmarks? ( + dev-python/twisted + dev-python/twisted-web + )" +DEPEND="${RDEPEND} + >=sys-devel/autoconf-2.61 + >=dev-util/pkgconfig-0.9.0 + doc? ( + app-doc/doxygen + mono? ( >=dev-util/monodoc-1.1.8 ) + )" + +pkg_setup() { + if use python && ! built_with_use dev-lang/python gdbm + then + die "For python support you need dev-lang/python compiled with gdbm support!" + fi + + if use python && use dbus && ! has_version dev-python/dbus-python && ! built_with_use sys-apps/dbus python + then + die "For python and dbus support you need sys-apps/dbus compiled with python support or dev-python/dbus-python!" + fi + + if ( use mdnsresponder-compat || use howl-compat || use mono ) && ! use dbus + then + die "For *-compat or mono support you also need to enable the dbus USE flag!" + fi + + if use bookmarks && ! ( use python && use dbus && use gtk ) + then + die "For bookmarks support you also need to enable the python, dbus and gtk USE flags!" + fi +} + +pkg_preinst() { + enewgroup netdev + enewgroup avahi + enewuser avahi -1 -1 -1 avahi + + if use autoipd + then + enewgroup avahi-autoipd + enewuser avahi-autoipd -1 -1 -1 avahi-autoipd + fi +} + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch "${FILESDIR}"/${PN}-0.6.1-no-ipv6.patch + epatch "${FILESDIR}"/${P}-svn-1353.patch + epatch "${FILESDIR}"/${P}-svn-1361.patch + epatch "${FILESDIR}"/${P}-svn-1363.patch + epatch "${FILESDIR}"/${P}-svn-1365.patch + epatch "${FILESDIR}"/${P}-svn-1366.patch + epatch "${FILESDIR}"/${P}-svn-1370.patch + epatch "${FILESDIR}"/${P}-svn-1371.patch + epatch "${FILESDIR}"/${P}-svn-1372.patch + epatch "${FILESDIR}"/${P}-svn-1374.patch +} + +src_compile() { + local myconf="" + + if use python + then + use dbus && myconf="${myconf} --enable-python-dbus" + use gtk && myconf="${myconf} --enable-pygtk" + fi + + if use mono && use doc + then + myconf="${myconf} --enable-monodoc" + fi + + # We need to unset DISPLAY, else the configure script might have problems detecting the pygtk module + unset DISPLAY + + econf \ + --localstatedir=/var \ + --with-distro=gentoo \ + --disable-python-dbus \ + --disable-pygtk \ + --disable-xmltoman \ + --disable-monodoc \ + --enable-glib \ + $(use_enable autoipd) \ + $(use_enable mdnsresponder-compat compat-libdns_sd) \ + $(use_enable howl-compat compat-howl) \ + $(use_enable doc doxygen-doc) \ + $(use_enable mono) \ + $(use_enable dbus) \ + $(use_enable python) \ + $(use_enable gtk) \ + $(use_enable qt3) \ + $(use_enable qt4) \ + $(use_enable gdbm) \ + ${myconf} \ + || die "econf failed" + emake || die "emake failed" +} + +src_install() { + make install DESTDIR="${D}" || die "make install failed" + use bookmarks || rm -f "${D}"/usr/bin/avahi-bookmarks + + use howl-compat && ln -s avahi-compat-howl.pc "${D}"/usr/$(get_libdir)/pkgconfig/howl.pc + use mdnsresponder-compat && ln -s avahi-compat-libdns_sd/dns_sd.h "${D}"/usr/include/dns_sd.h + + if use autoipd + then + insinto /lib/rcscripts/net + doins "${FILESDIR}"/autoipd.sh + fi + + dodoc docs/{AUTHORS,README,TODO} +} + +pkg_postrm() { + use python && python_mod_cleanup "${ROOT}"/usr/lib/python*/site-packages/avahi +} + +pkg_postinst() { + use python && python_mod_optimize "${ROOT}"/usr/lib/python*/site-packages/avahi + + if use autoipd + then + einfo + einfo "To use avahi-autoipd to configure your interfaces with IPv4LL (RFC3927)" + einfo "addresses, just set config_=( autoipd ) in /etc/conf.net!" + einfo + fi +} diff --git a/net-dns/avahi/files/avahi-0.6.16-svn-1353.patch b/net-dns/avahi/files/avahi-0.6.16-svn-1353.patch new file mode 100644 index 000000000000..4dc5563be417 --- /dev/null +++ b/net-dns/avahi/files/avahi-0.6.16-svn-1353.patch @@ -0,0 +1,13 @@ +Index: avahi-core/dns.c +=================================================================== +--- avahi-core/dns.c (revision 1352) ++++ avahi-core/dns.c (revision 1353) +@@ -400,6 +400,8 @@ + } else + return -1; + } ++ ++ return -1; + } + + int avahi_dns_packet_consume_name(AvahiDnsPacket *p, char *ret_name, size_t l) { diff --git a/net-dns/avahi/files/avahi-0.6.16-svn-1361.patch b/net-dns/avahi/files/avahi-0.6.16-svn-1361.patch new file mode 100644 index 000000000000..5b56b3b714f0 --- /dev/null +++ b/net-dns/avahi/files/avahi-0.6.16-svn-1361.patch @@ -0,0 +1,56 @@ +Index: avahi-core/socket.c +=================================================================== +--- avahi-core/socket.c (revision 1360) ++++ avahi-core/socket.c (revision 1361) +@@ -635,6 +635,9 @@ + goto fail; + } + ++ if (ms <= 0) ++ goto fail; ++ + p = avahi_dns_packet_new(ms + AVAHI_DNS_PACKET_EXTRA_SIZE); + + io.iov_base = AVAHI_DNS_PACKET_DATA(p); +@@ -650,7 +653,14 @@ + msg.msg_flags = 0; + + if ((l = recvmsg(fd, &msg, 0)) < 0) { +- avahi_log_warn("recvmsg(): %s", strerror(errno)); ++ /* Linux returns EAGAIN when an invalid IP packet has been ++ recieved. We suppress warnings in this case because this might ++ create quite a bit of log traffic on machines with unstable ++ links. (See #60) */ ++ ++ if (errno != EAGAIN) ++ avahi_log_warn("recvmsg(): %s", strerror(errno)); ++ + goto fail; + } + +@@ -768,6 +778,9 @@ + avahi_log_warn("ioctl(): %s", strerror(errno)); + goto fail; + } ++ ++ if (ms <= 0) ++ goto fail; + + p = avahi_dns_packet_new(ms + AVAHI_DNS_PACKET_EXTRA_SIZE); + +@@ -785,7 +798,14 @@ + msg.msg_flags = 0; + + if ((l = recvmsg(fd, &msg, 0)) < 0) { +- avahi_log_warn("recvmsg(): %s", strerror(errno)); ++ /* Linux returns EAGAIN when an invalid IP packet has been ++ recieved. We suppress warnings in this case because this might ++ create quite a bit of log traffic on machines with unstable ++ links. (See #60) */ ++ ++ if (errno != EAGAIN) ++ avahi_log_warn("recvmsg(): %s", strerror(errno)); ++ + goto fail; + } + diff --git a/net-dns/avahi/files/avahi-0.6.16-svn-1363.patch b/net-dns/avahi/files/avahi-0.6.16-svn-1363.patch new file mode 100644 index 000000000000..bb97b40a86ff --- /dev/null +++ b/net-dns/avahi/files/avahi-0.6.16-svn-1363.patch @@ -0,0 +1,26 @@ +Index: avahi-core/socket.c +=================================================================== +--- avahi-core/socket.c (revision 1362) ++++ avahi-core/socket.c (revision 1363) +@@ -475,10 +475,10 @@ + struct iovec io; + #ifdef IP_PKTINFO + struct cmsghdr *cmsg; +- uint8_t cmsg_data[CMSG_SPACE(sizeof(struct in_pktinfo))]; ++ size_t cmsg_data[( CMSG_SPACE(sizeof(struct in_pktinfo)) / sizeof(size_t)) + 1]; + #elif defined(IP_SENDSRCADDR) + struct cmsghdr *cmsg; +- uint8_t cmsg_data[CMSG_SPACE(sizeof(struct in_addr))]; ++ size_t cmsg_data[( CMSG_SPACE(sizeof(struct in_addr)) / sizeof(size_t)) + 1]; + #endif + + assert(fd >= 0); +@@ -565,7 +565,7 @@ + struct msghdr msg; + struct iovec io; + struct cmsghdr *cmsg; +- uint8_t cmsg_data[CMSG_SPACE(sizeof(struct in6_pktinfo))]; ++ size_t cmsg_data[(CMSG_SPACE(sizeof(struct in6_pktinfo))/sizeof(size_t)) + 1]; + + assert(fd >= 0); + assert(p); diff --git a/net-dns/avahi/files/avahi-0.6.16-svn-1365.patch b/net-dns/avahi/files/avahi-0.6.16-svn-1365.patch new file mode 100644 index 000000000000..c3aa8c47f3a2 --- /dev/null +++ b/net-dns/avahi/files/avahi-0.6.16-svn-1365.patch @@ -0,0 +1,258 @@ +Index: avahi-core/iface.c +=================================================================== +--- avahi-core/iface.c (revision 1364) ++++ avahi-core/iface.c (revision 1365) +@@ -50,9 +50,9 @@ + assert(a); + m = a->monitor; + +- if (a->interface->announcing && +- m->list_complete && ++ if (m->list_complete && + avahi_interface_address_is_relevant(a) && ++ avahi_interface_is_relevant(a->interface) && + !remove_rrs && + m->server->config.publish_addresses && + (m->server->state == AVAHI_SERVER_RUNNING || +@@ -67,11 +67,15 @@ + + if (avahi_s_entry_group_is_empty(a->entry_group)) { + char t[AVAHI_ADDRESS_STR_MAX]; ++ AvahiProtocol p; ++ ++ p = (a->interface->protocol == AVAHI_PROTO_INET && m->server->config.publish_a_on_ipv6) || ++ (a->interface->protocol == AVAHI_PROTO_INET6 && m->server->config.publish_aaaa_on_ipv4) ? AVAHI_PROTO_UNSPEC : a->interface->protocol; ++ + avahi_address_snprint(t, sizeof(t), &a->address); ++ avahi_log_info("Registering new address record for %s on %s.%s.", t, a->interface->hardware->name, p == AVAHI_PROTO_UNSPEC ? "*" : avahi_proto_to_string(p)); + +- avahi_log_info("Registering new address record for %s on %s.", t, a->interface->hardware->name); +- +- if (avahi_server_add_address(m->server, a->entry_group, a->interface->hardware->index, a->interface->protocol, 0, NULL, &a->address) < 0) { ++ if (avahi_server_add_address(m->server, a->entry_group, a->interface->hardware->index, p, 0, NULL, &a->address) < 0) { + avahi_log_warn(__FILE__": avahi_server_add_address() failed: %s", avahi_strerror(m->server->error)); + avahi_s_entry_group_free(a->entry_group); + a->entry_group = NULL; +@@ -171,6 +175,10 @@ + + if (!!join == !!i->mcast_joined) + return 0; ++ ++ if ((i->protocol == AVAHI_PROTO_INET6 && i->monitor->server->fd_ipv6 < 0) || ++ (i->protocol == AVAHI_PROTO_INET && i->monitor->server->fd_ipv4 < 0)) ++ return -1; + + if (join) { + AvahiInterfaceAddress *a; +@@ -186,10 +194,8 @@ + a = i->addresses; + + /* Hmm, there is no address available. */ +- if (!a) { +- avahi_log_warn(__FILE__": interface_mdns_mcast_join() called but no local address available."); ++ if (!a) + return -1; +- } + + i->local_mcast_address = a->address; + } +@@ -387,9 +393,9 @@ + + avahi_hashmap_insert(m->hashmap, &hw->index, hw); + +- if (m->server->fd_ipv4 >= 0) ++ if (m->server->fd_ipv4 >= 0 || m->server->config.publish_a_on_ipv6) + avahi_interface_new(m, hw, AVAHI_PROTO_INET); +- if (m->server->fd_ipv6 >= 0) ++ if (m->server->fd_ipv6 >= 0 || m->server->config.publish_aaaa_on_ipv4) + avahi_interface_new(m, hw, AVAHI_PROTO_INET6); + + return hw; +@@ -426,13 +432,16 @@ + b = avahi_interface_is_relevant(i); + + if (m->list_complete && b && !i->announcing) { +- avahi_log_info("New relevant interface %s.%s for mDNS.", i->hardware->name, avahi_proto_to_string(i->protocol)); +- + interface_mdns_mcast_join(i, 1); + +- i->announcing = 1; +- avahi_announce_interface(m->server, i); +- avahi_multicast_lookup_engine_new_interface(m->server->multicast_lookup_engine, i); ++ if (i->mcast_joined) { ++ avahi_log_info("New relevant interface %s.%s for mDNS.", i->hardware->name, avahi_proto_to_string(i->protocol)); ++ ++ i->announcing = 1; ++ avahi_announce_interface(m->server, i); ++ avahi_multicast_lookup_engine_new_interface(m->server->multicast_lookup_engine, i); ++ } ++ + } else if (!b && i->announcing) { + avahi_log_info("Interface %s.%s no longer relevant for mDNS.", i->hardware->name, avahi_proto_to_string(i->protocol)); + +@@ -553,7 +562,7 @@ + assert(i); + assert(p); + +- if (!avahi_interface_is_relevant(i)) ++ if (!i->announcing) + return; + + assert(!a || a->proto == i->protocol); +@@ -575,10 +584,10 @@ + assert(i); + assert(key); + +- if (avahi_interface_is_relevant(i)) +- return avahi_query_scheduler_post(i->query_scheduler, key, immediately, ret_id); +- +- return 0; ++ if (!i->announcing) ++ return 0; ++ ++ return avahi_query_scheduler_post(i->query_scheduler, key, immediately, ret_id); + } + + int avahi_interface_withraw_query(AvahiInterface *i, unsigned id) { +@@ -590,20 +599,20 @@ + assert(i); + assert(record); + +- if (avahi_interface_is_relevant(i)) +- return avahi_response_scheduler_post(i->response_scheduler, record, flush_cache, querier, immediately); +- +- return 0; ++ if (!i->announcing) ++ return 0; ++ ++ return avahi_response_scheduler_post(i->response_scheduler, record, flush_cache, querier, immediately); + } + + int avahi_interface_post_probe(AvahiInterface *i, AvahiRecord *record, int immediately) { + assert(i); + assert(record); + +- if (avahi_interface_is_relevant(i)) +- return avahi_probe_scheduler_post(i->probe_scheduler, record, immediately); ++ if (!i->announcing) ++ return 0; + +- return 0; ++ return avahi_probe_scheduler_post(i->probe_scheduler, record, immediately); + } + + int avahi_dump_caches(AvahiInterfaceMonitor *m, AvahiDumpCallback callback, void* userdata) { +@@ -625,21 +634,19 @@ + + int avahi_interface_is_relevant(AvahiInterface *i) { + AvahiInterfaceAddress *a; +- int relevant_address; + + assert(i); + +- relevant_address = 0; ++ if (!i->hardware->flags_ok) ++ return 0; + + for (a = i->addresses; a; a = a->address_next) +- if (avahi_interface_address_is_relevant(a)) { +- relevant_address = 1; +- break; +- } ++ if (avahi_interface_address_is_relevant(a)) ++ return 1; + +- return i->hardware->flags_ok && relevant_address; ++ return 0; + } +- ++ + int avahi_interface_address_is_relevant(AvahiInterfaceAddress *a) { + AvahiInterfaceAddress *b; + assert(a); +Index: avahi-core/announce.c +=================================================================== +--- avahi-core/announce.c (revision 1364) ++++ avahi-core/announce.c (revision 1365) +@@ -498,7 +498,7 @@ + assert(i); + + if (send_goodbye) +- if (avahi_interface_is_relevant(i)) { ++ if (i->announcing) { + AvahiEntry *e; + + for (e = s->entries; e; e = e->entries_next) +Index: avahi-core/core.h +=================================================================== +--- avahi-core/core.h (revision 1364) ++++ avahi-core/core.h (revision 1365) +@@ -63,6 +63,8 @@ + AvahiStringList *browse_domains; /**< Additional browsing domains */ + int disable_publishing; /**< Disable publishing of any record */ + int allow_point_to_point; /**< Enable publishing on POINTOPOINT interfaces */ ++ int publish_a_on_ipv6; /**< Publish an IPv4 A RR on IPv6 sockets */ ++ int publish_aaaa_on_ipv4; /**< Publish an IPv4 A RR on IPv6 sockets */ + } AvahiServerConfig; + + /** Allocate a new mDNS responder object. */ +@@ -148,6 +150,9 @@ + /** Set the wide area DNS servers */ + int avahi_server_set_wide_area_servers(AvahiServer *s, const AvahiAddress *a, unsigned n); + ++/** Return the current configuration of the server \since 0.6.17 */ ++const AvahiServerConfig* avahi_server_get_config(AvahiServer *s); ++ + AVAHI_C_DECL_END + + #endif +Index: avahi-core/server.c +=================================================================== +--- avahi-core/server.c (revision 1364) ++++ avahi-core/server.c (revision 1365) +@@ -803,7 +803,7 @@ + avahi_dns_packet_set_field(p, AVAHI_DNS_FIELD_ID, slot->id); + + for (j = s->monitor->interfaces; j; j = j->interface_next) +- if (avahi_interface_is_relevant(j) && ++ if (j->announcing && + j != i && + (s->config.reflect_ipv || j->protocol == i->protocol)) { + +@@ -884,7 +884,7 @@ + assert(src_address->proto == dst_address->proto); + + if (!(i = avahi_interface_monitor_get_interface(s->monitor, iface, src_address->proto)) || +- !avahi_interface_is_relevant(i)) { ++ !i->announcing) { + avahi_log_warn("Recieved packet from invalid interface."); + return; + } +@@ -977,7 +977,7 @@ + } + + if (!(j = avahi_interface_monitor_get_interface(s->monitor, slot->interface, slot->address.proto)) || +- !avahi_interface_is_relevant(j)) ++ !j->announcing) + return; + + /* Patch the original ID into this response */ +@@ -1560,6 +1560,8 @@ + c->browse_domains = NULL; + c->disable_publishing = 0; + c->allow_point_to_point = 0; ++ c->publish_aaaa_on_ipv4 = 1; ++ c->publish_a_on_ipv6 = 0; + + return c; + } +@@ -1721,3 +1723,9 @@ + avahi_wide_area_set_servers(s->wide_area_lookup_engine, a, n); + return AVAHI_OK; + } ++ ++const AvahiServerConfig* avahi_server_get_config(AvahiServer *s) { ++ assert(s); ++ ++ return &s->config; ++} diff --git a/net-dns/avahi/files/avahi-0.6.16-svn-1366.patch b/net-dns/avahi/files/avahi-0.6.16-svn-1366.patch new file mode 100644 index 000000000000..8f13aaf50289 --- /dev/null +++ b/net-dns/avahi/files/avahi-0.6.16-svn-1366.patch @@ -0,0 +1,96 @@ +Index: avahi-daemon/static-hosts.c +=================================================================== +--- avahi-daemon/static-hosts.c (revision 1365) ++++ avahi-daemon/static-hosts.c (revision 1366) +@@ -110,7 +110,9 @@ + static void add_static_host_to_server(StaticHost *h) + { + AvahiAddress a; ++ AvahiProtocol p; + int err; ++ const AvahiServerConfig *config; + + if (!h->group) + if (!(h->group = avahi_s_entry_group_new (avahi_server, entry_group_callback, h))) { +@@ -123,7 +125,12 @@ + return; + } + +- if ((err = avahi_server_add_address(avahi_server, h->group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, 0, h->host, &a))) { ++ config = avahi_server_get_config(avahi_server); ++ ++ p = (a.proto == AVAHI_PROTO_INET && config->publish_a_on_ipv6) || ++ (a.proto == AVAHI_PROTO_INET6 && config->publish_aaaa_on_ipv4) ? AVAHI_PROTO_UNSPEC : a.proto; ++ ++ if ((err = avahi_server_add_address(avahi_server, h->group, AVAHI_IF_UNSPEC, p, 0, h->host, &a))) { + avahi_log_error ("Static host name %s: avahi_server_add_address failure: %s", h->host, avahi_strerror(err)); + return; + } +Index: avahi-daemon/main.c +=================================================================== +--- avahi-daemon/main.c (revision 1365) ++++ avahi-daemon/main.c (revision 1366) +@@ -442,7 +442,7 @@ + static int is_yes(const char *s) { + assert(s); + +- return *s == 'y' || *s == 'Y'; ++ return *s == 'y' || *s == 'Y' || *s == '1' || *s == 't' || *s == 'T'; + } + + static int load_config_file(DaemonConfig *c) { +@@ -541,8 +541,12 @@ + c->server_config.add_service_cookie = is_yes(p->value); + else if (strcasecmp(p->key, "publish-dns-servers") == 0) { + avahi_strfreev(c->publish_dns_servers); +- c->publish_dns_servers = avahi_split_csv(p->value); +- } else { ++ c->publish_dns_servers = avahi_split_csv(p->value); ++ } else if (strcasecmp(p->key, "publish-a-on-ipv6") == 0) ++ c->server_config.publish_a_on_ipv6 = is_yes(p->value); ++ else if (strcasecmp(p->key, "publish-aaaa-on-ipv4") == 0) ++ c->server_config.publish_aaaa_on_ipv4 = is_yes(p->value); ++ else { + avahi_log_error("Invalid configuration key \"%s\" in group \"%s\"\n", p->key, g->name); + goto finish; + } +Index: avahi-daemon/avahi-daemon.conf +=================================================================== +--- avahi-daemon/avahi-daemon.conf (revision 1365) ++++ avahi-daemon/avahi-daemon.conf (revision 1366) +@@ -45,6 +45,8 @@ + #publish-domain=yes + #publish-dns-servers=192.168.50.1, 192.168.50.2 + #publish-resolv-conf-dns-servers=yes ++#publish-aaaa-on-ipv4=yes ++#publish-a-on-ipv6=no + + [reflector] + #enable-reflector=no +Index: man/avahi-daemon.conf.5.xml.in +=================================================================== +--- man/avahi-daemon.conf.5.xml.in (revision 1365) ++++ man/avahi-daemon.conf.5.xml.in (revision 1366) +@@ -223,6 +223,22 @@ + SIGHUP to have it reload this file. Defaults to "no".

+ + ++ ++ ++ ++ + + +
diff --git a/net-dns/avahi/files/avahi-0.6.16-svn-1370.patch b/net-dns/avahi/files/avahi-0.6.16-svn-1370.patch new file mode 100644 index 000000000000..13f6bcdbfc7e --- /dev/null +++ b/net-dns/avahi/files/avahi-0.6.16-svn-1370.patch @@ -0,0 +1,106 @@ +Index: avahi-core/socket.c +=================================================================== +--- avahi-core/socket.c (revision 1369) ++++ avahi-core/socket.c (revision 1370) +@@ -560,7 +560,14 @@ + return sendmsg_loop(fd, &msg, 0); + } + +-int avahi_send_dns_packet_ipv6(int fd, AvahiIfIndex interface, AvahiDnsPacket *p, const AvahiIPv6Address *src_address, const AvahiIPv6Address *dst_address, uint16_t dst_port) { ++int avahi_send_dns_packet_ipv6( ++ int fd, ++ AvahiIfIndex interface, ++ AvahiDnsPacket *p, ++ const AvahiIPv6Address *src_address, ++ const AvahiIPv6Address *dst_address, ++ uint16_t dst_port) { ++ + struct sockaddr_in6 sa; + struct msghdr msg; + struct iovec io; +@@ -617,7 +624,14 @@ + return sendmsg_loop(fd, &msg, 0); + } + +-AvahiDnsPacket *avahi_recv_dns_packet_ipv4(int fd, AvahiIPv4Address *ret_src_address, uint16_t *ret_src_port, AvahiIPv4Address *ret_dst_address, AvahiIfIndex *ret_iface, uint8_t *ret_ttl) { ++AvahiDnsPacket *avahi_recv_dns_packet_ipv4( ++ int fd, ++ AvahiIPv4Address *ret_src_address, ++ uint16_t *ret_src_port, ++ AvahiIPv4Address *ret_dst_address, ++ AvahiIfIndex *ret_iface, ++ uint8_t *ret_ttl) { ++ + AvahiDnsPacket *p= NULL; + struct msghdr msg; + struct iovec io; +@@ -635,8 +649,10 @@ + goto fail; + } + +- if (ms <= 0) ++ if (ms < 0) { ++ avahi_log_warn("FIONREAD returned negative value."); + goto fail; ++ } + + p = avahi_dns_packet_new(ms + AVAHI_DNS_PACKET_EXTRA_SIZE); + +@@ -761,7 +777,14 @@ + return NULL; + } + +-AvahiDnsPacket *avahi_recv_dns_packet_ipv6(int fd, AvahiIPv6Address *ret_src_address, uint16_t *ret_src_port, AvahiIPv6Address *ret_dst_address, AvahiIfIndex *ret_iface, uint8_t *ret_ttl) { ++AvahiDnsPacket *avahi_recv_dns_packet_ipv6( ++ int fd, ++ AvahiIPv6Address *ret_src_address, ++ uint16_t *ret_src_port, ++ AvahiIPv6Address *ret_dst_address, ++ AvahiIfIndex *ret_iface, ++ uint8_t *ret_ttl) { ++ + AvahiDnsPacket *p = NULL; + struct msghdr msg; + struct iovec io; +@@ -779,8 +802,10 @@ + goto fail; + } + +- if (ms <= 0) ++ if (ms < 0) { ++ avahi_log_warn("FIONREAD returned negative value."); + goto fail; ++ } + + p = avahi_dns_packet_new(ms + AVAHI_DNS_PACKET_EXTRA_SIZE); + +@@ -860,7 +885,7 @@ + + assert(found_iface); + assert(found_ttl); +- ++ + return p; + + fail: +@@ -912,13 +937,19 @@ + + int avahi_open_unicast_socket_ipv6(void) { + struct sockaddr_in6 local; +- int fd = -1; ++ int fd = -1, yes; + + if ((fd = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { + avahi_log_warn("socket() failed: %s", strerror(errno)); + goto fail; + } + ++ yes = 1; ++ if (setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &yes, sizeof(yes)) < 0) { ++ avahi_log_warn("IPV6_V6ONLY failed: %s", strerror(errno)); ++ goto fail; ++ } ++ + memset(&local, 0, sizeof(local)); + local.sin6_family = AF_INET6; + diff --git a/net-dns/avahi/files/avahi-0.6.16-svn-1371.patch b/net-dns/avahi/files/avahi-0.6.16-svn-1371.patch new file mode 100644 index 000000000000..e17900fc0183 --- /dev/null +++ b/net-dns/avahi/files/avahi-0.6.16-svn-1371.patch @@ -0,0 +1,15 @@ +Index: avahi-core/wide-area.c +=================================================================== +--- avahi-core/wide-area.c (revision 1370) ++++ avahi-core/wide-area.c (revision 1371) +@@ -579,8 +579,8 @@ + e->cleanup_dead = 0; + + /* Create sockets */ +- e->fd_ipv4 = avahi_open_unicast_socket_ipv4(); +- e->fd_ipv6 = avahi_open_unicast_socket_ipv6(); ++ e->fd_ipv4 = s->config.use_ipv4 ? avahi_open_unicast_socket_ipv4() : -1; ++ e->fd_ipv6 = s->config.use_ipv6 ? avahi_open_unicast_socket_ipv6() : -1; + + if (e->fd_ipv4 < 0 && e->fd_ipv6 < 0) { + avahi_log_error(__FILE__": Failed to create wide area sockets: %s", strerror(errno)); diff --git a/net-dns/avahi/files/avahi-0.6.16-svn-1372.patch b/net-dns/avahi/files/avahi-0.6.16-svn-1372.patch new file mode 100644 index 000000000000..ff4b7ad0d004 --- /dev/null +++ b/net-dns/avahi/files/avahi-0.6.16-svn-1372.patch @@ -0,0 +1,22 @@ +Index: avahi-daemon/static-hosts.c +=================================================================== +--- avahi-daemon/static-hosts.c (revision 1371) ++++ avahi-daemon/static-hosts.c (revision 1372) +@@ -116,7 +116,7 @@ + + if (!h->group) + if (!(h->group = avahi_s_entry_group_new (avahi_server, entry_group_callback, h))) { +- avahi_log_error("avahi_s_entry_group_new() failed: %s", avahi_strerror(err)); ++ avahi_log_error("avahi_s_entry_group_new() failed: %s", avahi_strerror(avahi_server_errno(avahi_server))); + return; + } + +@@ -130,7 +130,7 @@ + p = (a.proto == AVAHI_PROTO_INET && config->publish_a_on_ipv6) || + (a.proto == AVAHI_PROTO_INET6 && config->publish_aaaa_on_ipv4) ? AVAHI_PROTO_UNSPEC : a.proto; + +- if ((err = avahi_server_add_address(avahi_server, h->group, AVAHI_IF_UNSPEC, p, 0, h->host, &a))) { ++ if ((err = avahi_server_add_address(avahi_server, h->group, AVAHI_IF_UNSPEC, p, 0, h->host, &a)) < 0) { + avahi_log_error ("Static host name %s: avahi_server_add_address failure: %s", h->host, avahi_strerror(err)); + return; + } diff --git a/net-dns/avahi/files/avahi-0.6.16-svn-1374.patch b/net-dns/avahi/files/avahi-0.6.16-svn-1374.patch new file mode 100644 index 000000000000..89397fe4279d --- /dev/null +++ b/net-dns/avahi/files/avahi-0.6.16-svn-1374.patch @@ -0,0 +1,105 @@ +Index: avahi-compat-libdns_sd/compat.c +=================================================================== +--- avahi-compat-libdns_sd/compat.c (revision 1373) ++++ avahi-compat-libdns_sd/compat.c (revision 1374) +@@ -469,25 +469,26 @@ + } + + int DNSSD_API DNSServiceRefSockFD(DNSServiceRef sdref) { ++ ++ AVAHI_WARN_LINKAGE; ++ + if (!sdref || sdref->n_ref <= 0) + return -1; + +- AVAHI_WARN_LINKAGE; +- + return sdref->main_fd; + } + + DNSServiceErrorType DNSSD_API DNSServiceProcessResult(DNSServiceRef sdref) { + DNSServiceErrorType ret = kDNSServiceErr_Unknown; + +- assert(sdref); +- assert(sdref->n_ref >= 1); +- + AVAHI_WARN_LINKAGE; + ++ if (!sdref || sdref->n_ref <= 0) ++ return kDNSServiceErr_BadParam; ++ ++ sdref_ref(sdref); ++ + ASSERT_SUCCESS(pthread_mutex_lock(&sdref->mutex)); +- +- sdref_ref(sdref); + + /* Cleanup notification socket */ + if (read_command(sdref->main_fd) != COMMAND_POLL_DONE) +@@ -512,10 +513,10 @@ + + finish: + ++ ASSERT_SUCCESS(pthread_mutex_unlock(&sdref->mutex)); ++ + sdref_unref(sdref); + +- ASSERT_SUCCESS(pthread_mutex_unlock(&sdref->mutex)); +- + return ret; + } + +@@ -613,7 +614,6 @@ + + if (!ret_sdref) + return kDNSServiceErr_BadParam; +- + *ret_sdref = NULL; + + assert(regtype); +@@ -739,7 +739,10 @@ + + AVAHI_WARN_LINKAGE; + +- assert(ret_sdref); ++ if (!ret_sdref) ++ return kDNSServiceErr_BadParam; ++ *ret_sdref = NULL; ++ + assert(name); + assert(regtype); + assert(domain); +@@ -853,7 +856,10 @@ + + AVAHI_WARN_LINKAGE; + +- assert(ret_sdref); ++ if (!ret_sdref) ++ return kDNSServiceErr_BadParam; ++ *ret_sdref = NULL; ++ + assert(callback); + + if (interface == kDNSServiceInterfaceIndexLocalOnly || +@@ -1096,7 +1102,6 @@ + + if (!ret_sdref) + return kDNSServiceErr_BadParam; +- + *ret_sdref = NULL; + + if (!regtype) +@@ -1210,10 +1215,12 @@ + + int ret = kDNSServiceErr_Unknown; + AvahiStringList *txt = NULL; +- assert(sdref); + + AVAHI_WARN_LINKAGE; + ++ if (!sdref || sdref->n_ref <= 0) ++ return kDNSServiceErr_BadParam; ++ + if (flags || rref) { + AVAHI_WARN_UNSUPPORTED; + return kDNSServiceErr_Unsupported; diff --git a/net-dns/avahi/files/digest-avahi-0.6.16-r1 b/net-dns/avahi/files/digest-avahi-0.6.16-r1 new file mode 100644 index 000000000000..5917dd6b84d0 --- /dev/null +++ b/net-dns/avahi/files/digest-avahi-0.6.16-r1 @@ -0,0 +1,3 @@ +MD5 3cbc460bbd55bae35f7b57443c063640 avahi-0.6.16.tar.gz 891970 +RMD160 0106c3082867715052b416e3c761d8f052de00a0 avahi-0.6.16.tar.gz 891970 +SHA256 794d4d1c485d4dc24659a25feb92706eb8bff4552333a1df83e856db123c36ce avahi-0.6.16.tar.gz 891970 -- 2.26.2