Several cleanups and fixes:

* add a couple of fixes from avahi trac
* advise users to enable multicast
* kill RTM_VERSION warning as advised by claudio@
* disallow other stacks by default

ok naddy@
This commit is contained in:
ajacoutot 2009-06-26 22:12:20 +00:00
parent 44dfaa3845
commit 9de49696d5
7 changed files with 106 additions and 13 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.6 2009/06/16 21:50:01 jasper Exp $
# $OpenBSD: Makefile,v 1.7 2009/06/26 22:12:20 ajacoutot Exp $
COMMENT-main= framework for Multicast DNS Service Discovery
COMMENT-gtk= GUI client utilities for avahi
@ -9,10 +9,10 @@ V= 0.6.25
DISTNAME= avahi-${V}
CATEGORIES= net devel
PKGNAME-main= avahi-${V}p4
PKGNAME-gtk= avahi-gtk-${V}p0
PKGNAME-qt3= avahi-qt3-${V}p0
PKGNAME-qt4= avahi-qt4-${V}p0
PKGNAME-main= avahi-${V}p5
PKGNAME-gtk= avahi-gtk-${V}p1
PKGNAME-qt3= avahi-qt3-${V}p1
PKGNAME-qt4= avahi-qt4-${V}p1
MAINTAINER= Antoine Jacoutot <ajacoutot@openbsd.org>

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-avahi-core_announce_c,v 1.1 2009/06/26 22:12:20 ajacoutot Exp $
http://avahi.org/ticket/267
--- avahi-core/announce.c.orig Wed Jun 18 01:13:44 2008
+++ avahi-core/announce.c Thu Jun 25 17:32:51 2009
@@ -376,7 +376,7 @@ static int is_duplicate_entry(AvahiServer *s, AvahiEnt
for (i = avahi_hashmap_lookup(s->entries_by_key, e->record->key); i; i = i->by_key_next) {
- if (i == e)
+ if ((i == e) || (i->dead))
continue;
if (!avahi_record_equal_no_ttl(i->record, e->record))

View File

@ -0,0 +1,24 @@
$OpenBSD: patch-avahi-core_entry_c,v 1.1 2009/06/26 22:12:20 ajacoutot Exp $
http://avahi.org/ticket/267
--- avahi-core/entry.c.orig Wed Jun 18 01:13:44 2008
+++ avahi-core/entry.c Thu Jun 25 17:32:54 2009
@@ -1087,6 +1087,8 @@ void avahi_s_entry_group_free(AvahiSEntryGroup *g) {
g->server->need_group_cleanup = 1;
g->server->need_entry_cleanup = 1;
+
+ avahi_cleanup_dead_entries(g->server);
}
static void entry_group_commit_real(AvahiSEntryGroup *g) {
@@ -1166,6 +1168,8 @@ void avahi_s_entry_group_reset(AvahiSEntryGroup *g) {
g->n_probing = 0;
avahi_s_entry_group_change_state(g, AVAHI_ENTRY_GROUP_UNCOMMITED);
+
+ avahi_cleanup_dead_entries(g->server);
}
int avahi_entry_is_commited(AvahiEntry *e) {

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-avahi-core_iface-pfroute_c,v 1.2 2009/06/06 18:36:43 ajacoutot Exp $
$OpenBSD: patch-avahi-core_iface-pfroute_c,v 1.3 2009/06/26 22:12:20 ajacoutot Exp $
--- avahi-core/iface-pfroute.c.orig Fri Dec 12 22:36:15 2008
+++ avahi-core/iface-pfroute.c Sat Jun 6 20:16:04 2009
+++ avahi-core/iface-pfroute.c Thu Jun 25 21:31:39 2009
@@ -48,6 +48,13 @@
#include "iface-pfroute.h"
#include "util.h"
@ -15,3 +15,14 @@ $OpenBSD: patch-avahi-core_iface-pfroute_c,v 1.2 2009/06/06 18:36:43 ajacoutot E
static int bitcount (unsigned int n)
{
int count=0 ;
@@ -242,8 +249,10 @@ static void parse_rtmsg(struct rt_msghdr *rtm, AvahiIn
assert(rtm);
if (rtm->rtm_version != RTM_VERSION) {
+#ifndef __OpenBSD__
avahi_log_warn("routing message version %d not understood",
rtm->rtm_version);
+#endif
return;
}

View File

@ -1,9 +1,9 @@
$OpenBSD: patch-avahi-core_server_c,v 1.1.1.1 2009/06/03 16:27:12 ajacoutot Exp $
$OpenBSD: patch-avahi-core_server_c,v 1.2 2009/06/26 22:12:20 ajacoutot Exp $
CVE-2008-5081.
CVE-2008-5081 + http://avahi.org/ticket/267
--- avahi-core/server.c.orig Tue Apr 14 03:28:56 2009
+++ avahi-core/server.c Sun May 31 19:20:04 2009
+++ avahi-core/server.c Thu Jun 25 17:36:04 2009
@@ -904,6 +904,11 @@ static void dispatch_packet(AvahiServer *s, AvahiDnsPa
return;
}
@ -16,3 +16,35 @@ CVE-2008-5081.
if (avahi_address_is_ipv4_in_ipv6(src_address))
/* This is an IPv4 address encapsulated in IPv6, so let's ignore it. */
return;
@@ -1009,13 +1014,6 @@ static void dispatch_legacy_unicast_packet(AvahiServer
avahi_dns_packet_set_field(p, AVAHI_DNS_FIELD_ID, slot->id);
}
-static void cleanup_dead(AvahiServer *s) {
- assert(s);
-
- avahi_cleanup_dead_entries(s);
- avahi_browser_cleanup(s);
-}
-
static void mcast_socket_event(AvahiWatch *w, int fd, AvahiWatchEvent events, void *userdata) {
AvahiServer *s = userdata;
AvahiAddress dest, src;
@@ -1048,7 +1046,7 @@ static void mcast_socket_event(AvahiWatch *w, int fd,
avahi_dns_packet_free(p);
- cleanup_dead(s);
+ avahi_cleanup_dead_entries(s);
}
}
@@ -1071,7 +1069,7 @@ static void legacy_unicast_socket_event(AvahiWatch *w,
dispatch_legacy_unicast_packet(s, p);
avahi_dns_packet_free(p);
- cleanup_dead(s);
+ avahi_cleanup_dead_entries(s);
}
}

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-avahi-daemon_avahi-daemon_conf,v 1.2 2009/06/06 18:36:43 ajacoutot Exp $
$OpenBSD: patch-avahi-daemon_avahi-daemon_conf,v 1.3 2009/06/26 22:12:20 ajacoutot Exp $
--- avahi-daemon/avahi-daemon.conf.orig Fri Dec 12 22:36:15 2008
+++ avahi-daemon/avahi-daemon.conf Sat Jun 6 20:18:20 2009
@@ -23,9 +23,9 @@
+++ avahi-daemon/avahi-daemon.conf Thu Jun 25 19:48:37 2009
@@ -23,15 +23,15 @@
[server]
#host-name=foo
#domain-name=local
@ -13,3 +13,10 @@ $OpenBSD: patch-avahi-daemon_avahi-daemon_conf,v 1.2 2009/06/06 18:36:43 ajacout
#allow-interfaces=eth0
#deny-interfaces=eth1
#check-response-ttl=no
#use-iff-running=no
#enable-dbus=yes
-#disallow-other-stacks=no
+disallow-other-stacks=yes
#allow-point-to-point=no
[wide-area]

View File

@ -1,3 +1,7 @@
For proper function, multicast(4) needs to be enabled. To do so, add the
following line to /etc/rc.conf.local:
multicast_host=YES
To start avahi automatically, add the following to /etc/rc.local:
(after dbus-daemon but before Zeroconf-aware applications startup)