Skip to content

Commit 23240a6

Browse files
committed
zebra: fix disable radvd upon interface deletion event
If the radvd service is used on a physical interface, the service is not stopped and may be reused upon re-creation of that physical interface. Fix this by stopping the radvd service. Signed-off-by: Philippe Guibert <[email protected]>
1 parent 426bdd1 commit 23240a6

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

zebra/interface.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@ void if_delete_update(struct interface **pifp)
764764
memset(&zif->brslave_info, 0,
765765
sizeof(struct zebra_l2info_brslave));
766766
zebra_evpn_mac_ifp_del(ifp);
767+
zebra_rtadv_disable_per_interface(zif);
767768
}
768769

769770
if (!ifp->configured) {

zebra/rtadv.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,20 +1560,22 @@ static void zebra_interface_radv_set(ZAPI_HANDLER_ARGS, int enable)
15601560
&& !CHECK_FLAG(zif->rtadv.ra_configured,
15611561
VTY_RA_INTERVAL_CONFIGURED))
15621562
zif->rtadv.MaxRtrAdvInterval = ra_interval * 1000;
1563-
} else {
1564-
if (CHECK_FLAG(zif->rtadv.ra_configured, BGP_RA_CONFIGURED))
1565-
interfaces_configured_for_ra_from_bgp--;
1563+
} else
1564+
zebra_rtadv_disable_per_interface(zif);
1565+
stream_failure:
1566+
return;
1567+
}
15661568

1569+
void zebra_rtadv_disable_per_interface(struct zebra_if *zif)
1570+
{
1571+
if (CHECK_FLAG(zif->rtadv.ra_configured, BGP_RA_CONFIGURED)) {
1572+
interfaces_configured_for_ra_from_bgp--;
15671573
UNSET_FLAG(zif->rtadv.ra_configured, BGP_RA_CONFIGURED);
1568-
if (!CHECK_FLAG(zif->rtadv.ra_configured,
1569-
VTY_RA_INTERVAL_CONFIGURED))
1570-
zif->rtadv.MaxRtrAdvInterval =
1571-
RTADV_MAX_RTR_ADV_INTERVAL;
1572-
if (!CHECK_FLAG(zif->rtadv.ra_configured, VTY_RA_CONFIGURED))
1573-
ipv6_nd_suppress_ra_set(ifp, RA_SUPPRESS);
15741574
}
1575-
stream_failure:
1576-
return;
1575+
if (!CHECK_FLAG(zif->rtadv.ra_configured, VTY_RA_INTERVAL_CONFIGURED))
1576+
zif->rtadv.MaxRtrAdvInterval = RTADV_MAX_RTR_ADV_INTERVAL;
1577+
if (!CHECK_FLAG(zif->rtadv.ra_configured, VTY_RA_CONFIGURED))
1578+
ipv6_nd_suppress_ra_set(zif->ifp, RA_SUPPRESS);
15771579
}
15781580

15791581
/*

zebra/rtadv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,7 @@ static inline void rtadv_stop_ra_all(void)
504504

505505
extern void zebra_interface_radv_disable(ZAPI_HANDLER_ARGS);
506506
extern void zebra_interface_radv_enable(ZAPI_HANDLER_ARGS);
507+
extern void zebra_rtadv_disable_per_interface(struct zebra_if *zif);
507508

508509
extern uint32_t rtadv_get_interfaces_configured_from_bgp(void);
509510
extern bool rtadv_compiled_in(void);

0 commit comments

Comments
 (0)