Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP4
keepalived.35327
bsc-1228123.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File bsc-1228123.patch of Package keepalived.35327
--- keepalived-2.2.8/keepalived/core/global_parser.c.orig 2024-08-13 18:02:02.156517132 +0200 +++ keepalived-2.2.8/keepalived/core/global_parser.c 2024-08-13 18:19:37.021046617 +0200 @@ -1091,12 +1091,21 @@ vrrp_ipsets_handler(const vector_t *strv { size_t len; char set_name[IPSET_MAXNAMELEN]; + unsigned sn0, sn1; + const char **set_names[] = { + &global_data->vrrp_ipset_address, + &global_data->vrrp_ipset_address6, + &global_data->vrrp_ipset_address_iface6, + &global_data->vrrp_ipset_igmp, + &global_data->vrrp_ipset_mld, + }; FREE_CONST_PTR(global_data->vrrp_ipset_address); FREE_CONST_PTR(global_data->vrrp_ipset_address6); FREE_CONST_PTR(global_data->vrrp_ipset_address_iface6); FREE_CONST_PTR(global_data->vrrp_ipset_igmp); FREE_CONST_PTR(global_data->vrrp_ipset_mld); + global_data->using_ipsets = PARAMETER_UNSET; if (vector_size(strvec) < 2) { global_data->using_ipsets = false; @@ -1105,14 +1114,14 @@ vrrp_ipsets_handler(const vector_t *strv if (strlen(strvec_slot(strvec,1)) >= IPSET_MAXNAMELEN - 1) { report_config_error(CONFIG_GENERAL_ERROR, "VRRP Error : ipset address name too long - ignored"); - return; + goto ipset_error; } global_data->vrrp_ipset_address = STRDUP(strvec_slot(strvec,1)); if (vector_size(strvec) >= 3) { if (strlen(strvec_slot(strvec,2)) >= IPSET_MAXNAMELEN - 1) { report_config_error(CONFIG_GENERAL_ERROR, "VRRP Error : ipset IPv6 address name too long - ignored"); - return; + goto ipset_error; } global_data->vrrp_ipset_address6 = STRDUP(strvec_slot(strvec,2)); } @@ -1126,7 +1135,7 @@ vrrp_ipsets_handler(const vector_t *strv if (vector_size(strvec) >= 4) { if (strlen(strvec_slot(strvec,3)) >= IPSET_MAXNAMELEN - 1) { report_config_error(CONFIG_GENERAL_ERROR, "VRRP Error : ipset IPv6 address_iface name too long - ignored"); - return; + goto ipset_error; } global_data->vrrp_ipset_address_iface6 = STRDUP(strvec_slot(strvec,3)); } @@ -1144,7 +1153,7 @@ vrrp_ipsets_handler(const vector_t *strv if (vector_size(strvec) >= 5) { if (strlen(strvec_slot(strvec,4)) >= IPSET_MAXNAMELEN - 1) { report_config_error(CONFIG_GENERAL_ERROR, "VRRP Error : ipset IGMP name too long - ignored"); - return; + goto ipset_error; } global_data->vrrp_ipset_igmp = STRDUP(strvec_slot(strvec,4)); } @@ -1158,7 +1167,7 @@ vrrp_ipsets_handler(const vector_t *strv if (vector_size(strvec) >= 6) { if (strlen(strvec_slot(strvec,5)) >= IPSET_MAXNAMELEN - 1) { report_config_error(CONFIG_GENERAL_ERROR, "VRRP Error : ipset MLD name too long - ignored"); - return; + goto ipset_error; } global_data->vrrp_ipset_mld = STRDUP(strvec_slot(strvec,5)); } @@ -1169,6 +1178,23 @@ vrrp_ipsets_handler(const vector_t *strv strcat(set_name, "_mld"); global_data->vrrp_ipset_mld = STRDUP(set_name); } + /* Ensure all the set names are different */ + for (sn0 = 0; sn0 < sizeof(set_names) / sizeof(set_names[0]) - 1; sn0++) { + for (sn1 = sn0 + 1; sn1 < sizeof(set_names) / sizeof(set_names[0]); sn1++) { + if (!strcmp(*set_names[sn0], *set_names[sn1])) { + report_config_error(CONFIG_GENERAL_ERROR, "vrrp_ipsets: set name %s used more than once", *set_names[sn0]); + goto ipset_error; + } + } + } + global_data->using_ipsets = true; + return; +ipset_error: + FREE_CONST_PTR(global_data->vrrp_ipset_address); + FREE_CONST_PTR(global_data->vrrp_ipset_address6); + FREE_CONST_PTR(global_data->vrrp_ipset_address_iface6); + FREE_CONST_PTR(global_data->vrrp_ipset_igmp); + FREE_CONST_PTR(global_data->vrrp_ipset_mld); } #endif #elif defined _WITH_NFTABLES_
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor