X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fprocess.c;fp=src%2Fmain%2Fprocess.c;h=2a70e2306d786aa2b49fd2bf7bcafea18a553205;hb=7bae7c8ed3ae6420c749f04ab3cb716e00071389;hp=16345df730a1720a2df613fd434e81b502fc2e00;hpb=fa93a223ca4d3d903f17d1cb0501f2e2c3ca7032;p=freeradius.git diff --git a/src/main/process.c b/src/main/process.c index 16345df..2a70e23 100644 --- a/src/main/process.c +++ b/src/main/process.c @@ -3055,7 +3055,6 @@ static void ping_home_server(void *ctx) struct timeval when, now; if ((home->state == HOME_STATE_ALIVE) || - (home->ping_check == HOME_PING_CHECK_NONE) || #ifdef WITH_TCP (home->proto == IPPROTO_TCP) || #endif @@ -3065,6 +3064,9 @@ static void ping_home_server(void *ctx) gettimeofday(&now, NULL); + /* + * We've run out of zombie time. Mark it dead. + */ if (home->state == HOME_STATE_ZOMBIE) { when = home->zombie_period_start; when.tv_sec += home->zombie_period; @@ -3076,6 +3078,25 @@ static void ping_home_server(void *ctx) } } + /* + * We're not supposed to be pinging it. Just wake up + * when we're supposed to mark it dead. + */ + if (home->ping_check == HOME_PING_CHECK_NONE) { + if (home->state == HOME_STATE_ZOMBIE) { + when = home->zombie_period_start; + when.tv_sec += home->zombie_period; + INSERT_EVENT(ping_home_server, home); + } + + /* + * Else mark_home_server_dead will set a timer + * for revive_interval. + */ + return; + } + + request = request_alloc(NULL); request->number = request_num_counter++; NO_CHILD_THREAD;