Skip to content

Commit

Permalink
zebra: fix build with --disable-rtadv
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Ryzhov <[email protected]>
  • Loading branch information
idryzhov committed Jan 24, 2024
1 parent 52e588c commit c00de57
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 4 deletions.
12 changes: 10 additions & 2 deletions mgmtd/mgmt_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,16 @@ static struct frr_signal_t mgmt_signals[] = {
extern const struct frr_yang_module_info frr_staticd_info;
#endif

#if HAVE_BFDD == 0 || defined(HAVE_RTADV)
const char *zebra_features[] = {
#if HAVE_BFDD == 0
const char *zebra_features[] = { "ptm-bfd", NULL };
"ptm-bfd",
#endif
#if defined(HAVE_RTADV)
"ipv6-router-advertisements",
#endif
NULL
};
#endif

/*
Expand All @@ -152,7 +160,7 @@ const char *zebra_features[] = { "ptm-bfd", NULL };
*/
const struct frr_yang_module_info zebra_info = {
.name = "frr-zebra",
#if HAVE_BFDD == 0
#if HAVE_BFDD == 0 || defined(HAVE_RTADV)
.features = zebra_features,
#endif
.ignore_cfg_cbs = true,
Expand Down
6 changes: 6 additions & 0 deletions yang/frr-zebra.yang
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ module frr-zebra {
"Initial revision.";
}

feature ipv6-router-advertisements {
description
"Support for IPv6 Router Advertisements.";
}

feature ptm-bfd {
description
"Using an external PTM daemon that implements BFD.";
Expand Down Expand Up @@ -2270,6 +2275,7 @@ module frr-zebra {
}
}
container ipv6-router-advertisements {
if-feature "ipv6-router-advertisements";
description
"Support for IPv6 Router Advertisements.";
leaf send-advertisements {
Expand Down
14 changes: 12 additions & 2 deletions zebra/zebra_nb.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,22 @@
#include "libfrr.h"
#include "zebra_nb.h"

#if HAVE_BFDD == 0 || defined(HAVE_RTADV)
const char *features[] = {
#if HAVE_BFDD == 0
const char *features[] = { "ptm-bfd", NULL };
"ptm-bfd",
#endif
#if defined(HAVE_RTADV)
"ipv6-router-advertisements",
#endif
NULL
};
#endif

/* clang-format off */
const struct frr_yang_module_info frr_zebra_info = {
.name = "frr-zebra",
#if HAVE_BFDD == 0
#if HAVE_BFDD == 0 || defined(HAVE_RTADV)
.features = features,
#endif
.nodes = {
Expand Down Expand Up @@ -561,6 +569,7 @@ const struct frr_yang_module_info frr_zebra_info = {
.modify = lib_interface_zebra_evpn_mh_uplink_modify,
}
},
#if defined(HAVE_RTADV)
{
.xpath = "/frr-interface:lib/interface/frr-zebra:zebra/ipv6-router-advertisements/send-advertisements",
.cbs = {
Expand Down Expand Up @@ -720,6 +729,7 @@ const struct frr_yang_module_info frr_zebra_info = {
.destroy = lib_interface_zebra_ipv6_router_advertisements_rdnss_rdnss_address_lifetime_destroy,
}
},
#endif /* defined(HAVE_RTADV) */
#if HAVE_BFDD == 0
{
.xpath = "/frr-interface:lib/interface/frr-zebra:zebra/ptm-enable",
Expand Down
2 changes: 2 additions & 0 deletions zebra/zebra_nb.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ int lib_interface_zebra_evpn_mh_df_preference_modify(
struct nb_cb_modify_args *args);
int lib_interface_zebra_evpn_mh_bypass_modify(struct nb_cb_modify_args *args);
int lib_interface_zebra_evpn_mh_uplink_modify(struct nb_cb_modify_args *args);
#if defined(HAVE_RTADV)
int lib_interface_zebra_ipv6_router_advertisements_send_advertisements_modify(
struct nb_cb_modify_args *args);
int lib_interface_zebra_ipv6_router_advertisements_max_rtr_adv_interval_modify(
Expand Down Expand Up @@ -252,6 +253,7 @@ int lib_interface_zebra_ipv6_router_advertisements_dnssl_dnssl_domain_lifetime_m
struct nb_cb_modify_args *args);
int lib_interface_zebra_ipv6_router_advertisements_dnssl_dnssl_domain_lifetime_destroy(
struct nb_cb_destroy_args *args);
#endif /* defined(HAVE_RTADV) */
#if HAVE_BFDD == 0
int lib_interface_zebra_ptm_enable_modify(struct nb_cb_modify_args *args);
#endif
Expand Down
2 changes: 2 additions & 0 deletions zebra/zebra_nb_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -2478,6 +2478,7 @@ int lib_interface_zebra_evpn_mh_uplink_modify(struct nb_cb_modify_args *args)
return NB_OK;
}

#if defined(HAVE_RTADV)
/*
* XPath: /frr-interface:lib/interface/frr-zebra:zebra/ipv6-router-advertisements/send-advertisements
*/
Expand Down Expand Up @@ -3199,6 +3200,7 @@ int lib_interface_zebra_ipv6_router_advertisements_dnssl_dnssl_domain_lifetime_d

return NB_OK;
}
#endif /* defined(HAVE_RTADV) */

#if HAVE_BFDD == 0
/*
Expand Down

0 comments on commit c00de57

Please sign in to comment.