Skip to content

Commit

Permalink
Merge pull request #2397 from jimying/fix-macro
Browse files Browse the repository at this point in the history
Fix lack macro for find_rttables_group()
  • Loading branch information
pqarmitage committed Mar 29, 2024
2 parents 9d4579b + 53c4ac4 commit db4b11d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
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

0 comments on commit db4b11d

Please sign in to comment.