"VRRP virtual router hash");
vrf_init(NULL, NULL, NULL, NULL, NULL);
}
+
+void vrrp_fini(void)
+{
+ /* Destroy all instances */
+ struct list *vrs = hash_to_list(vrrp_vrouters_hash);
+
+ struct listnode *ln;
+ struct vrrp_vrouter *vr;
+
+ for (ALL_LIST_ELEMENTS_RO(vrs, ln, vr)) {
+ vrrp_vrouter_destroy(vr);
+ }
+
+ list_delete(&vrs);
+
+ hash_clean(vrrp_vrouters_hash, NULL);
+ hash_free(vrrp_vrouters_hash);
+}
*/
void vrrp_init(void);
+/*
+ * Destroy all VRRP instances and gracefully shutdown.
+ *
+ * For instances in Master state, VRRP advertisements with 0 priority will be
+ * sent if possible to notify Backup routers that we are going away.
+ */
+void vrrp_fini(void);
+
/* Creation and destruction ------------------------------------------------ */
}
/* SIGINT / SIGTERM handler. */
-static void sigint(void)
+static void __attribute__((noreturn)) sigint(void)
{
zlog_notice("Terminating on signal");
+ vrrp_fini();
+
exit(0);
}