Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions keepalived/check/check_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -1070,15 +1070,30 @@ check_check_script_security(void)
bool
validate_check_config(void)
{
virtual_server_t *vs, *vs_tmp;
virtual_server_t *vs, *vs_tmp, *vs1;
virtual_server_group_entry_t *vsge;
real_server_t *rs, *rs_tmp, *rs1;
checker_t *checker;
unsigned weight_sum;
bool rs_removed;
bool vs_removed, rs_removed;

using_ha_suspend = false;
list_for_each_entry_safe(vs, vs_tmp, &check_data->vs, e_list) {
/* Check the virual server is not a duplicate of any vs earlier in the list */
vs_removed = false;
list_for_each_entry(vs1, &check_data->vs, e_list) {
if (vs == vs1)
break;
if (vs_iseq(vs, vs1)) {
report_config_error(CONFIG_GENERAL_ERROR, "Virtual server %s is duplicated - removing second vs and all its related rs and checker entities.", FMT_VS(vs));
free_vs(vs);
vs_removed = true;
break;
}
}
if (vs_removed)
continue;

/* Ensure that ha_suspend is not set for any virtual server using fwmarks */
if (vs->ha_suspend &&
(vs->vfwmark || (vs->vsg && !list_empty(&vs->vsg->vfwmark)))) {
Expand Down
2 changes: 1 addition & 1 deletion keepalived/check/ipwrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include "check_data.h"
#endif

static bool __attribute((pure))
bool __attribute((pure))
vs_iseq(const virtual_server_t *vs_a, const virtual_server_t *vs_b)
{
if (!vs_a->vsgname != !vs_b->vsgname)
Expand Down
1 change: 1 addition & 0 deletions keepalived/include/ipwrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ rs_iseq(const real_server_t *rs_a, const real_server_t *rs_b)
{
return sockstorage_equal(&rs_a->addr, &rs_b->addr);
}
extern bool __attribute__((pure)) vs_iseq(const virtual_server_t *, const virtual_server_t *);

/* prototypes */
extern void update_svr_wgt(int64_t, virtual_server_t *, real_server_t *, bool);
Expand Down