diff options
author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2019-05-30 20:14:50 +0200 |
---|---|---|
committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2019-06-22 15:10:56 +0200 |
commit | 49cc9e7b64473f5ebc3a3e117a44dce3389d02df (patch) | |
tree | b025466b16c9536ed1c526a87caacee83b5a4755 | |
parent | bfdd: fix northbound remote-discriminator display (diff) | |
download | frr-49cc9e7b64473f5ebc3a3e117a44dce3389d02df.tar.xz frr-49cc9e7b64473f5ebc3a3e117a44dce3389d02df.zip |
bfdd: implement configuration reload
Reload configuration on SIGHUP using the northbound.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
-rw-r--r-- | bfdd/bfdd.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/bfdd/bfdd.c b/bfdd/bfdd.c index 5a6089f38..5657744f7 100644 --- a/bfdd/bfdd.c +++ b/bfdd/bfdd.c @@ -39,6 +39,9 @@ struct thread_master *master; /* BFDd privileges */ static zebra_capabilities_t _caps_p[] = {ZCAP_BIND, ZCAP_SYS_ADMIN, ZCAP_NET_RAW}; +/* BFD daemon information. */ +static struct frr_daemon_info bfdd_di; + void socket_close(int *s) { if (*s <= 0) @@ -78,6 +81,14 @@ static void sigterm_handler(void) exit(0); } +static void sighup_handler(void) +{ + zlog_info("SIGHUP received"); + + /* Reload config file. */ + vty_read_config(NULL, bfdd_di.config_file, config_default); +} + static struct quagga_signal_t bfd_signals[] = { { .signal = SIGUSR1, @@ -91,6 +102,10 @@ static struct quagga_signal_t bfd_signals[] = { .signal = SIGINT, .handler = &sigterm_handler, }, + { + .signal = SIGHUP, + .handler = &sighup_handler, + }, }; static const struct frr_yang_module_info *bfdd_yang_modules[] = { |