1
0
forked from ports/contrib

avahi: fix source and fix a race condition in IPv6

This commit is contained in:
Danny Rawlins 2021-02-19 22:25:44 +11:00
parent 792002833d
commit a5639ea0b2
3 changed files with 59 additions and 5 deletions

View File

@ -1,7 +1,8 @@
untrusted comment: verify with /etc/ports/contrib.pub
RWSagIOpLGJF30Fp1X+qWjjsDc8GPIqbTZXhvGSFOesjUcuQwh7bqk2JO5DZZcGFj/P8xc0FJgDh7ENb0VLEcOYpdyuNFvmwDgU=
SHA256 (Pkgfile) = 8dcd6ea01b1adfaf0eb5ecc4a4453ae47360b5f2ac5322e83ba932cf34ef4a89
RWSagIOpLGJF39oPNixkLCJb0e/QbVjzfMX3C8UoXG3o16AklPygfRA0AsmpuW1bfMLSTKTniQp0zx5WmJItCjJUum3W5zn7CwA=
SHA256 (Pkgfile) = 71c66d8077a1fe691c1f5f2a95c0bda68049e7ce0044a44a25c2b30a3541555e
SHA256 (.footprint) = aa8ee19b71233a73a128054c70c616b4fc2fb7fe2d16d90d5c1c4c645b2b14e1
SHA256 (avahi-0.8.tar.gz) = 060309d7a333d38d951bc27598c677af1796934dbd98e1024e7ad8de798fedda
SHA256 (avahi-0.8-ipv6_race_condition_fix-1.patch) = 218c909581d0ca2c86c8145bb0797050d987a6b0ae3417949dbe2a6d55c49360
SHA256 (avahi-daemon.rc) = 032e83dd665f95436234309226c11d31231ab4fd7689c9d6cf64efbf8d3db8a3
SHA256 (reverse-move-to-run.patch) = a333bcf15dd3e72ac99b2e883202e7170d2ff27bf61820413235bc9f3c9c2605

View File

@ -5,13 +5,15 @@
name=avahi
version=0.8
release=1
source=(http://avahi.org/download/$name-$version.tar.gz \
release=2
source=(https://github.com/lathiat/avahi/releases/download/v$version/$name-$version.tar.gz
avahi-0.8-ipv6_race_condition_fix-1.patch
avahi-daemon.rc reverse-move-to-run.patch)
build() {
cd $name-$version
patch -Np1 -i ../reverse-move-to-run.patch
patch -Np1 -i $SRC/reverse-move-to-run.patch
patch -Np1 -i $SRC/avahi-0.8-ipv6_race_condition_fix-1.patch
NOCONFIGURE=1 ./autogen.sh
./configure --prefix=/usr \
--sysconfdir=/etc \

View File

@ -0,0 +1,51 @@
Submitted By: Douglas R. Reno <renodr at linuxfromscratch dot org>
Date: 2020-10-19
Initial Package Version: 0.8
Upstream Status: PR, not applied
Origin: Upstream PR (github.com/lathiat/avahi/pull/309)
Description: Fixes a race condition when multiple NICs are in use
when IPv6 is enabled. This will exhibit behavior where
messages about withdrawing address records, registering
access records, and new hostname announcements are
spammed to the log every second.
diff -Naurp avahi-0.8.orig/avahi-core/server.c avahi-0.8/avahi-core/server.c
--- avahi-0.8.orig/avahi-core/server.c 2020-02-16 21:41:24.939967558 -0600
+++ avahi-0.8/avahi-core/server.c 2020-10-19 11:07:22.054861721 -0500
@@ -193,7 +193,7 @@ static void withdraw_rrset(AvahiServer *
withdraw_entry(s, e);
}
-static void incoming_probe(AvahiServer *s, AvahiRecord *record, AvahiInterface *i) {
+static void incoming_probe(AvahiServer *s, AvahiRecord *record, AvahiInterface *i, int from_local_iface) {
AvahiEntry *e, *n;
int ours = 0, won = 0, lost = 0;
@@ -210,7 +210,7 @@ static void incoming_probe(AvahiServer *
if (e->dead)
continue;
- if ((cmp = avahi_record_lexicographical_compare(e->record, record)) == 0) {
+ if ((cmp = avahi_record_lexicographical_compare(e->record, record)) == 0 || from_local_iface) {
ours = 1;
break;
} else {
@@ -639,7 +639,7 @@ static void handle_query_packet(AvahiSer
if (!avahi_key_is_pattern(record->key)) {
if (!from_local_iface)
reflect_probe(s, i, record);
- incoming_probe(s, record, i);
+ incoming_probe(s, record, i, from_local_iface);
}
avahi_record_unref(record);
@@ -961,8 +961,7 @@ static void dispatch_packet(AvahiServer
return;
/* We don't want to reflect local traffic, so we check if this packet is generated locally. */
- if (s->config.enable_reflector)
- from_local_iface = originates_from_local_iface(s, iface, src_address, port);
+ from_local_iface = originates_from_local_iface(s, iface, src_address, port);
if (avahi_dns_packet_check_valid_multicast(p) < 0) {
avahi_log_debug("Received invalid packet.");