summaryrefslogtreecommitdiff
path: root/avahi-autoipd
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2008-12-12 21:26:27 +0100
committerLennart Poettering <lennart@poettering.net>2008-12-12 21:26:27 +0100
commitf8ef650e9d7b633c67509666599c15f205fa5baf (patch)
tree3568bcb02c439bc858eaddf1e724cb67dd2d73ba /avahi-autoipd
parent1946f54fc6380ee57dcd3f2f491270c7b08a8479 (diff)
downloadavahi-f8ef650e9d7b633c67509666599c15f205fa5baf.tar.gz
Fix --force-bind logic
Quoting Cocagne: "line 1280 of autoipd's main.c: "else if (event == EVENT_ROUTABLE_ADDR_CONFIGURED)" is missing '&& !force_bind' in the conditional. The lack of this condition causes the local link IP to be released even if the --force-bind arugment is passed. The problem was noticed when attempting to use avahi-autoipd acquire a link-local address during the early-userspace in a Linux initramfs. Immediately after the call-out script assinged the ll-address to the device, the daemon released the address via this conditional. It's suspicious that the daemon would consider this address "routable" but, even if it were, --force-bind should prevent the address from being released. After adding the && !force_bind to the conditional the daemon appeard to behave as expected." Closes #209.
Diffstat (limited to 'avahi-autoipd')
-rw-r--r--avahi-autoipd/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/avahi-autoipd/main.c b/avahi-autoipd/main.c
index ef529b9..eb71c3b 100644
--- a/avahi-autoipd/main.c
+++ b/avahi-autoipd/main.c
@@ -1281,7 +1281,7 @@ static int loop(int iface, uint32_t addr) {
DEBUG(daemon_log(LOG_DEBUG, "Ignoring irrelevant ARP packet."));
}
- } else if (event == EVENT_ROUTABLE_ADDR_CONFIGURED) {
+ } else if (event == EVENT_ROUTABLE_ADDR_CONFIGURED && !force_bind) {
daemon_log(LOG_INFO, "A routable address has been configured.");
@@ -1306,7 +1306,7 @@ static int loop(int iface, uint32_t addr) {
elapse_time(&next_wakeup, 0, PROBE_WAIT*1000);
next_wakeup_valid = 1;
- } else if (event == EVENT_REFRESH_REQUEST && state == STATE_RUNNING && !force_bind) {
+ } else if (event == EVENT_REFRESH_REQUEST && state == STATE_RUNNING) {
/* The user requested a reannouncing of the address by a SIGHUP */
daemon_log(LOG_INFO, "Reannouncing address.");