diff options
author | Lennart Poettering <lennart@poettering.net> | 2006-08-30 21:20:53 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2006-08-30 21:20:53 +0000 |
commit | fee9053f6a8a22ff53d59fc7865230ad41fdf760 (patch) | |
tree | 7861b97a27d693f07005f8d8fd9b88ccd7cf945b /avahi-autoipd/main.c | |
parent | 834cc833bb7bb608f778c32a1f3b5bee2f09f7c0 (diff) |
a few fixes in netlink handling
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1289 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-autoipd/main.c')
-rw-r--r-- | avahi-autoipd/main.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/avahi-autoipd/main.c b/avahi-autoipd/main.c index 200cab0..feb88ee 100644 --- a/avahi-autoipd/main.c +++ b/avahi-autoipd/main.c @@ -230,14 +230,14 @@ static void set_state(State st, int reset_counter) { static int add_address(int iface, uint32_t addr) { char buf[64]; - daemon_log(LOG_INFO, "Selected address %s", inet_ntop(AF_INET, &addr, buf, sizeof(buf))); + daemon_log(LOG_INFO, "Configuring address %s", inet_ntop(AF_INET, &addr, buf, sizeof(buf))); return 0; } static int remove_address(int iface, uint32_t addr) { char buf[64]; - daemon_log(LOG_INFO, "Removing address %s", inet_ntop(AF_INET, &addr, buf, sizeof(buf))); + daemon_log(LOG_INFO, "Unconfiguring address %s", inet_ntop(AF_INET, &addr, buf, sizeof(buf))); return 0; } @@ -464,6 +464,8 @@ static int loop(int iface, uint32_t addr) { daemon_log(LOG_INFO, "Successfully claimed IP address %s", inet_ntop(AF_INET, &addr, buf, sizeof(buf))); set_state(STATE_RUNNING, 0); + + next_wakeup_valid = 0; } else if (event == EVENT_PACKET) { ArpPacketInfo info; @@ -514,10 +516,11 @@ static int loop(int iface, uint32_t addr) { daemon_log(LOG_INFO, "A routable address has been configured."); - set_state(STATE_SLEEPING, 1); - if (state == STATE_RUNNING || state == STATE_ANNOUNCING) remove_address(iface, addr); + + set_state(STATE_SLEEPING, 1); + next_wakeup_valid = 0; } else if (event == EVENT_ROUTABLE_ADDR_UNCONFIGURED && state == STATE_SLEEPING) { @@ -655,7 +658,6 @@ fail: /* TODO: -- netlink - man page - user script - chroot/drop privs/caps |