Skip to content

Commit

Permalink
sorry_server: keep sorry_server on reload
Browse files Browse the repository at this point in the history
  • Loading branch information
ze42 committed Jan 9, 2017
1 parent cf3b236 commit 6e06804
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions keepalived/check/ipwrapper.c
Expand Up @@ -686,6 +686,27 @@ clear_diff_rs(virtual_server_t * old_vs, list new_rs_list)
return ret;
}

/* clear sorry server, but only if changed */
int
clear_diff_s_srv(virtual_server_t * old_vs, real_server_t * new_rs)
{
real_server_t * old_rs = old_vs->s_svr;

if (old_rs && new_rs && RS_ISEQ(old_rs, new_rs)) {
/* which fields are really used on s_svr? */
new_rs->alive = old_rs->alive;
new_rs->set = old_rs->set;
new_rs->weight = old_rs->weight;
new_rs->pweight = old_rs->iweight;
new_rs->reloaded = true;
return 1;
}
if (old_rs && ISALIVE(old_rs))
ipvs_cmd(LVS_CMD_DEL_DEST, old_vs, old_rs);

return 1;
}

/* When reloading configuration, remove negative diff entries
* and copy status of existing entries to the new ones */
void
Expand Down Expand Up @@ -732,8 +753,8 @@ clear_diff_services(void)
vs->omega = true;
if (!clear_diff_rs(vs, new_vs->rs))
return;
if (vs->s_svr && ISALIVE(vs->s_svr))
ipvs_cmd(LVS_CMD_DEL_DEST, vs, vs->s_svr);
if (!clear_diff_s_srv(vs, new_vs->s_svr))
return;
}
}
}
Expand Down

0 comments on commit 6e06804

Please sign in to comment.