Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lack macro for find_rttables_group() #2397

Merged
merged 1 commit into from
Mar 29, 2024
Merged
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
4 changes: 4 additions & 0 deletions keepalived/vrrp/vrrp_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ vrrp_vmac_handler(const vector_t *strvec)
continue;
}

#if HAVE_DECL_FRA_SUPPRESS_IFGROUP
if (!strcmp(strvec_slot(strvec, i), "group")) {
uint32_t group;
if (!find_rttables_group(strvec_slot(strvec, ++i), &group)) {
Expand All @@ -581,6 +582,7 @@ vrrp_vmac_handler(const vector_t *strvec)
current_vrrp->vmac_group = group;
continue;
}
#endif

if (!strcmp(strvec_slot(strvec, i), "name")) {
/* Skip over "name" */
Expand Down Expand Up @@ -695,6 +697,7 @@ vrrp_ipvlan_handler(const vector_t *strvec)
continue;
}

#if HAVE_DECL_FRA_SUPPRESS_IFGROUP
if (!strcmp(strvec_slot(strvec, i), "group")) {
uint32_t group;
if (!find_rttables_group(strvec_slot(strvec, ++i), &group)) {
Expand All @@ -705,6 +708,7 @@ vrrp_ipvlan_handler(const vector_t *strvec)
current_vrrp->vmac_group = group;
continue;
}
#endif

if (!strcmp(strvec_slot(strvec, i), "name")) {
i++;
Expand Down
2 changes: 2 additions & 0 deletions lib/rttables.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,13 @@ find_rttables_dsfield(const char *name, uint8_t *id)
return ret;
}

#if HAVE_DECL_FRA_SUPPRESS_IFGROUP && defined _WITH_SNMP_VRRP_
bool
find_rttables_group(const char *name, uint32_t *id)
{
return find_entry(name, id, &rt_groups, RT_GROUPS_FILE, NULL, INT32_MAX);
}
#endif

bool
find_rttables_realms(const char *name, uint32_t *id)
Expand Down
2 changes: 2 additions & 0 deletions lib/rttables.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ extern void clear_rt_names(void);
extern bool find_rttables_table(const char *, uint32_t *);
extern bool find_rttables_dsfield(const char *, uint8_t *);
extern bool find_rttables_realms(const char *, uint32_t *);
#if HAVE_DECL_FRA_SUPPRESS_IFGROUP && defined _WITH_SNMP_VRRP_
extern bool find_rttables_group(const char *, uint32_t *);
#endif
extern bool find_rttables_proto(const char *, uint8_t *);
extern bool find_rttables_rtntype(const char *, uint8_t *);
extern bool find_rttables_scope(const char *, uint8_t *);
Expand Down
Loading