]> git.proxmox.com Git - mirror_frr.git/commitdiff
ripd: fix SIGHUP handling
authorRenato Westphal <renato@opensourcerouting.org>
Mon, 2 Jul 2018 01:24:29 +0000 (22:24 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Sat, 27 Oct 2018 18:16:12 +0000 (16:16 -0200)
We can now leverage the new northbound API to perform a full configuration
reload in ripd without the need for external help (i.e. frr-reload.py).

When vty_read_config() is called with the 'config' parameter set to
NULL, it performs a new configuration transaction where the running
configuration is *replaced* by the provided configuration file. With that
said, we don't need to do anything other than calling this function in
the SIGHUP handler of all FRR daemons. If a daemon hasn't been converted
to the new northbound model, vty_read_config() will simply *merge*
the configuration file into the running configuration.

The calls to rip_clean() and rip_reset() in the SIGUP handler were
changing configuration variables directly, bypassing the northbound
layer. Configuration variables should be changed only by the northbound
callbacks, and failure to respect that inevitably leads to inconsistencies
and crashes. Fix this.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
ripd/rip_main.c
ripd/ripd.c
ripd/ripd.h

index 23981d6d6651952c11a036a2d3a9ec14c3082bec..5db9c4b7e9e0250d9240a9404d5163de9db210e6 100644 (file)
@@ -71,14 +71,9 @@ static struct frr_daemon_info ripd_di;
 static void sighup(void)
 {
        zlog_info("SIGHUP received");
-       rip_clean();
-       rip_reset();
-       zlog_info("ripd restarting!");
 
        /* Reload config file. */
        vty_read_config(NULL, ripd_di.config_file, config_default);
-
-       /* Try to return to normal operation. */
 }
 
 /* SIGINT handler. */
index c0474ea93f65e5029f795869ffe30b065c6d74c0..5dab61b4e1f22ca1b4b1d926f7faf591480cfbea 100644 (file)
@@ -3374,30 +3374,6 @@ void rip_clean(void)
        rip_redistribute_clean();
 }
 
-/* Reset all values to the default settings. */
-void rip_reset(void)
-{
-       /* Reset global counters. */
-       rip_global_route_changes = 0;
-       rip_global_queries = 0;
-
-       /* Call ripd related reset functions. */
-       rip_debug_reset();
-       rip_route_map_reset();
-
-       /* Call library reset functions. */
-       vty_reset();
-       access_list_reset();
-       prefix_list_reset();
-
-       distribute_list_reset();
-
-       rip_interfaces_reset();
-       rip_distance_reset();
-
-       rip_zclient_reset();
-}
-
 static void rip_if_rmap_update(struct if_rmap *if_rmap)
 {
        struct interface *ifp;
index faf0d6f3b10a2c18d6ca97167fd25eeaf9d416f4..6af99ada217c5faa1497a769ce8caa77a25ae3f1 100644 (file)
@@ -373,7 +373,6 @@ struct rip_offset_list {
 
 /* Prototypes. */
 extern void rip_init(void);
-extern void rip_reset(void);
 extern void rip_clean(void);
 extern void rip_clean_network(void);
 extern void rip_interfaces_clean(void);