summaryrefslogtreecommitdiff
path: root/zebra/rtadv.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/rtadv.c')
-rw-r--r--zebra/rtadv.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/zebra/rtadv.c b/zebra/rtadv.c
index 350b97cc5d..83b141cd7a 100644
--- a/zebra/rtadv.c
+++ b/zebra/rtadv.c
@@ -47,6 +47,8 @@
extern struct zebra_privs_t zserv_privs;
+static uint32_t interfaces_configured_for_ra_from_bgp;
+
#if defined(HAVE_RTADV)
#ifndef VTYSH_EXTRACT_PL
@@ -1282,6 +1284,9 @@ static void zebra_interface_radv_set(ZAPI_HANDLER_ARGS, int enable)
zif = ifp->info;
if (enable) {
+ if (!CHECK_FLAG(zif->rtadv.ra_configured, BGP_RA_CONFIGURED))
+ interfaces_configured_for_ra_from_bgp++;
+
SET_FLAG(zif->rtadv.ra_configured, BGP_RA_CONFIGURED);
ipv6_nd_suppress_ra_set(ifp, RA_ENABLE);
if (ra_interval
@@ -1290,6 +1295,9 @@ static void zebra_interface_radv_set(ZAPI_HANDLER_ARGS, int enable)
VTY_RA_INTERVAL_CONFIGURED))
zif->rtadv.MaxRtrAdvInterval = ra_interval * 1000;
} else {
+ if (CHECK_FLAG(zif->rtadv.ra_configured, BGP_RA_CONFIGURED))
+ interfaces_configured_for_ra_from_bgp--;
+
UNSET_FLAG(zif->rtadv.ra_configured, BGP_RA_CONFIGURED);
if (!CHECK_FLAG(zif->rtadv.ra_configured,
VTY_RA_INTERVAL_CONFIGURED))
@@ -2766,6 +2774,8 @@ void rtadv_vrf_terminate(struct zebra_vrf *zvrf)
void rtadv_cmd_init(void)
{
+ interfaces_configured_for_ra_from_bgp = 0;
+
hook_register(zebra_if_extra_info, nd_dump_vty);
hook_register(zebra_if_config_wr, rtadv_config_write);
@@ -2865,6 +2875,11 @@ static int if_leave_all_router(int sock, struct interface *ifp)
return 0;
}
+bool rtadv_compiled_in(void)
+{
+ return true;
+}
+
#else
void rtadv_vrf_init(struct zebra_vrf *zvrf)
{
@@ -2920,4 +2935,14 @@ void zebra_interface_radv_enable(ZAPI_HANDLER_ARGS)
return;
}
+bool rtadv_compiled_in(void)
+{
+ return false;
+}
+
#endif /* HAVE_RTADV */
+
+uint32_t rtadv_get_interfaces_configured_from_bgp(void)
+{
+ return interfaces_configured_for_ra_from_bgp;
+}