summaryrefslogtreecommitdiffstats
path: root/ripd
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2018-07-02 03:24:29 +0200
committerRenato Westphal <renato@opensourcerouting.org>2018-10-27 20:16:12 +0200
commitbc1bdde2f678b5ae21735461f724f1ed12da712e (patch)
treed39798ca915f38bf3bc2194ea1f92d945d539647 /ripd
parentripd: fix memory leaks when interfaces are deleted (diff)
downloadfrr-bc1bdde2f678b5ae21735461f724f1ed12da712e.tar.xz
frr-bc1bdde2f678b5ae21735461f724f1ed12da712e.zip
ripd: fix SIGHUP handling
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>
Diffstat (limited to 'ripd')
-rw-r--r--ripd/rip_main.c5
-rw-r--r--ripd/ripd.c24
-rw-r--r--ripd/ripd.h1
3 files changed, 0 insertions, 30 deletions
diff --git a/ripd/rip_main.c b/ripd/rip_main.c
index 23981d6d6..5db9c4b7e 100644
--- a/ripd/rip_main.c
+++ b/ripd/rip_main.c
@@ -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. */
diff --git a/ripd/ripd.c b/ripd/ripd.c
index c0474ea93..5dab61b4e 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -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;
diff --git a/ripd/ripd.h b/ripd/ripd.h
index faf0d6f3b..6af99ada2 100644
--- a/ripd/ripd.h
+++ b/ripd/ripd.h
@@ -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);