[avahi] Issue found in avahi-autoipd when running in default mode of operation.
Jen Chitty
JenChitty at vtech.ca
Thu Oct 8 15:51:03 PDT 2009
Hi,
I've found a bug when using avahi-autoipd in its default mode
of operation (as described on the AvahiAutoipd page in the Wiki):
If a routeable address is configured, avahi-autoipd goes to sleep without
configuring the interface, but it is still listening for ARP packets.
If an ARP packet is seen from the LL address it chose for itself
at start-up, it acts on this ARP as if there was a conflict and configures
the network interface with an LL address.
The following patch to main.c fixes this problem:
{{{
1267c1267,1280
< daemon_log(LOG_INFO, "Trying address %s",
inet_ntop(AF_INET, &addr, buf, sizeof(buf)));
---
> if (state == STATE_SLEEPING)
> daemon_log(LOG_INFO, "Selected new address %s",
inet_ntop(AF_INET, &addr, buf, sizeof(buf)));
> else {
> daemon_log(LOG_INFO, "Trying address %s",
inet_ntop(AF_INET, &addr, buf, sizeof(buf)));
>
> n_conflict++;
>
> set_state(STATE_WAITING_PROBE, 1, addr);
>
> if (n_conflict >= MAX_CONFLICTS) {
> daemon_log(LOG_WARNING, "Got too many
conflicts, rate limiting new probes.");
> elapse_time(&next_wakeup,
RATE_LIMIT_INTERVAL*1000, PROBE_WAIT*1000);
> } else
> elapse_time(&next_wakeup, 0,
PROBE_WAIT*1000);
1269,1279c1282,1283
< n_conflict++;
<
< set_state(STATE_WAITING_PROBE, 1, addr);
<
< if (n_conflict >= MAX_CONFLICTS) {
< daemon_log(LOG_WARNING, "Got too many conflicts,
rate limiting new probes.");
< elapse_time(&next_wakeup,
RATE_LIMIT_INTERVAL*1000, PROBE_WAIT*1000);
< } else
< elapse_time(&next_wakeup, 0, PROBE_WAIT*1000);
<
< next_wakeup_valid = 1;
---
> next_wakeup_valid = 1;
> }
}}}
Essentially, I'm just adding a state check right after a new address is
selected. If sleeping, the new address is just logged and autoipd goes
back to sleep, otherwise the conflict handling code that was there before
is executed.
Thanks.
--JT
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/avahi/attachments/20091008/b951f98c/attachment.html
More information about the avahi
mailing list