summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_mplsvpn.c8
-rw-r--r--lib/privs.c4
-rw-r--r--lib/thread.c3
-rw-r--r--ospfd/ospf_main.c1
-rw-r--r--ospfd/ospfd.c5
-rw-r--r--pbrd/pbr_main.c2
-rw-r--r--pimd/pim_zebra.c2
-rw-r--r--sharpd/sharp_main.c2
-rw-r--r--staticd/static_main.c3
-rw-r--r--tests/topotests/lib/bgp.py4
-rw-r--r--vrrpd/vrrp_main.c2
11 files changed, 29 insertions, 7 deletions
diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c
index 46dcd2864e..3b82c60ae9 100644
--- a/bgpd/bgp_mplsvpn.c
+++ b/bgpd/bgp_mplsvpn.c
@@ -1095,6 +1095,14 @@ vpn_leak_to_vrf_update_onevrf(struct bgp *bgp_vrf, /* to */
new_ecom = ecommunity_dup(old_ecom);
ecommunity_strip_rts(new_ecom);
static_attr.ecommunity = new_ecom;
+
+ if (new_ecom->size == 0) {
+ UNSET_FLAG(static_attr.flag,
+ ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES));
+ ecommunity_free(&new_ecom);
+ static_attr.ecommunity = NULL;
+ }
+
if (!old_ecom->refcnt)
ecommunity_free(&old_ecom);
}
diff --git a/lib/privs.c b/lib/privs.c
index 09efedf684..eb0dbe0783 100644
--- a/lib/privs.c
+++ b/lib/privs.c
@@ -406,9 +406,11 @@ static void zprivs_caps_init(struct zebra_privs_t *zprivs)
static void zprivs_caps_terminate(void)
{
- /* clear all capabilities */
+ /* Clear all capabilities, if we have any. */
if (zprivs_state.caps)
cap_clear(zprivs_state.caps);
+ else
+ return;
/* and boom, capabilities are gone forever */
if (cap_set_proc(zprivs_state.caps)) {
diff --git a/lib/thread.c b/lib/thread.c
index 4d689a9f88..9b2f5661ac 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -1094,7 +1094,8 @@ static void do_thread_cancel(struct thread_master *master)
}
/* Delete and free all cancellation requests */
- list_delete_all_node(master->cancel_req);
+ if (master->cancel_req)
+ list_delete_all_node(master->cancel_req);
/* Wake up any threads which may be blocked in thread_cancel_async() */
master->canceled = true;
diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c
index e534e72a64..45382e48d3 100644
--- a/ospfd/ospf_main.c
+++ b/ospfd/ospf_main.c
@@ -98,6 +98,7 @@ static void sigint(void)
{
zlog_notice("Terminating on signal");
ospf_terminate();
+ exit(0);
}
/* SIGUSR1 handler. */
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c
index e9f622d217..cdfcaa44d6 100644
--- a/ospfd/ospfd.c
+++ b/ospfd/ospfd.c
@@ -517,9 +517,9 @@ void ospf_terminate(void)
SET_FLAG(om->options, OSPF_MASTER_SHUTDOWN);
- /* exit immediately if OSPF not actually running */
+ /* Skip some steps if OSPF not actually running */
if (listcount(om->ospf) == 0)
- exit(0);
+ goto done;
bfd_gbl_exit();
for (ALL_LIST_ELEMENTS(om->ospf, node, nnode, ospf))
@@ -543,6 +543,7 @@ void ospf_terminate(void)
zclient_stop(zclient);
zclient_free(zclient);
+done:
frr_fini();
}
diff --git a/pbrd/pbr_main.c b/pbrd/pbr_main.c
index 57338738f6..9a9edd79c6 100644
--- a/pbrd/pbr_main.c
+++ b/pbrd/pbr_main.c
@@ -82,6 +82,8 @@ static void sigint(void)
{
zlog_notice("Terminating on signal");
+ frr_fini();
+
exit(0);
}
diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c
index 8355c2099d..d089dfda51 100644
--- a/pimd/pim_zebra.c
+++ b/pimd/pim_zebra.c
@@ -728,7 +728,7 @@ void igmp_source_forward_start(struct pim_instance *pim,
}
}
- if (PIM_I_am_DR(pim_oif)) {
+ if (PIM_I_am_DR(pim_oif) || PIM_I_am_DualActive(pim_oif)) {
result = pim_channel_add_oif(source->source_channel_oil,
group->group_igmp_sock->interface,
PIM_OIF_FLAG_PROTO_IGMP, __func__);
diff --git a/sharpd/sharp_main.c b/sharpd/sharp_main.c
index db65836388..40b41fd728 100644
--- a/sharpd/sharp_main.c
+++ b/sharpd/sharp_main.c
@@ -81,6 +81,8 @@ static void sigint(void)
{
zlog_notice("Terminating on signal");
+ frr_fini();
+
exit(0);
}
diff --git a/staticd/static_main.c b/staticd/static_main.c
index 08062f19d8..3c5922b85a 100644
--- a/staticd/static_main.c
+++ b/staticd/static_main.c
@@ -42,6 +42,7 @@ char backup_config_file[256];
bool mpls_enabled;
+
zebra_capabilities_t _caps_p[] = {
};
@@ -75,6 +76,8 @@ static void sigint(void)
static_vrf_terminate();
+ frr_fini();
+
exit(0);
}
diff --git a/tests/topotests/lib/bgp.py b/tests/topotests/lib/bgp.py
index 2ba0c68c2f..16369156a5 100644
--- a/tests/topotests/lib/bgp.py
+++ b/tests/topotests/lib/bgp.py
@@ -1394,7 +1394,7 @@ def clear_bgp_and_verify(tgen, topo, router):
peer_uptime_before_clear_bgp = {}
# Verifying BGP convergence before bgp clear command
- for retry in range(31):
+ for retry in range(44):
sleeptime = 3
# Waiting for BGP to converge
logger.info(
@@ -1477,7 +1477,7 @@ def clear_bgp_and_verify(tgen, topo, router):
peer_uptime_after_clear_bgp = {}
# Verifying BGP convergence after bgp clear command
- for retry in range(31):
+ for retry in range(44):
sleeptime = 3
# Waiting for BGP to converge
logger.info(
diff --git a/vrrpd/vrrp_main.c b/vrrpd/vrrp_main.c
index d8c35dd2a3..ce274d4810 100644
--- a/vrrpd/vrrp_main.c
+++ b/vrrpd/vrrp_main.c
@@ -82,6 +82,8 @@ static void __attribute__((noreturn)) sigint(void)
vrrp_fini();
+ frr_fini();
+
exit(0);
}