X-Git-Url: http://git.archive.openwrt.org/?p=project%2Frelayd.git;a=blobdiff_plain;f=main.c;h=24435b49b459e0de7e97365ad5088de6944f0583;hp=a78076c7f1b37e972ac83f0ce10197de44d99ad3;hb=a1ecc7303afbcb9070aa864571e078c8e317a967;hpb=d49528ef9ccc74a90b0828fcd94408374a8af4b1 diff --git a/main.c b/main.c index a78076c..24435b4 100644 --- a/main.c +++ b/main.c @@ -252,6 +252,7 @@ static void send_arp_reply(struct relayd_interface *rif, const uint8_t spa[4], static void host_entry_timeout(struct uloop_timeout *timeout) { struct relayd_host *host = container_of(timeout, struct relayd_host, timeout); + struct relayd_interface *rif; /* * When a host is behind a managed interface, we must not expire its host @@ -261,7 +262,9 @@ static void host_entry_timeout(struct uloop_timeout *timeout) * giving up on it. */ if (host->rif->managed && host->cleanup_pending < host_ping_tries) { - send_arp_request(host->rif, host->ipaddr); + list_for_each_entry(rif, &interfaces, list) { + send_arp_request(rif, host->ipaddr); + } host->cleanup_pending++; uloop_timeout_set(&host->timeout, 1000); return; @@ -667,9 +670,7 @@ static void die(int signo) * When we hit SIGTERM, clean up interfaces directly, so that we * won't leave our routing in an invalid state. */ - cleanup_hosts(); - free_interfaces(); - exit(1); + uloop_end(); } static int usage(const char *progname)