From 5c689534f6d7d8db8eb59500648b8deb9ee1d70b Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Wed, 8 Mar 2017 16:00:45 +0100 Subject: [PATCH 1/5] ospfd: remove unused usage() function ... forgot this one in the previous patchset. Signed-off-by: David Lamparter --- ospfd/ospf_main.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/ospfd/ospf_main.c b/ospfd/ospf_main.c index 5705dad5d4..f462c207e4 100644 --- a/ospfd/ospf_main.c +++ b/ospfd/ospf_main.c @@ -93,21 +93,6 @@ struct thread_master *master; extern int ospf_apiserver_enable; #endif /* SUPPORT_OSPF_API */ -/* Help information display. */ -static void __attribute__ ((noreturn)) -usage (char *progname, int status) -{ - if (status != 0) - fprintf (stderr, "Try `%s --help' for more information.\n", progname); - else - { - printf ("Usage : %s [OPTION...]\n\ -\n\ -Report bugs to %s\n", progname, FRR_BUG_ADDRESS); - } - exit (status); -} - /* SIGHUP handler. */ static void sighup (void) From 6dd7b12a05387ef8b84ed9d4b8306a715ee64d0d Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Wed, 8 Mar 2017 16:03:35 +0100 Subject: [PATCH 2/5] isisd: remove reload-by-reexec This is a quite horrible mechanism... Signed-off-by: David Lamparter --- isisd/isis_main.c | 39 +-------------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/isisd/isis_main.c b/isisd/isis_main.c index a6ad424ace..644b652d44 100644 --- a/isisd/isis_main.c +++ b/isisd/isis_main.c @@ -89,35 +89,15 @@ struct option longopts[] = { /* Master of threads. */ struct thread_master *master; -/* for reload */ -char _cwd[MAXPATHLEN]; -char _progpath[MAXPATHLEN]; -int _argc; -char **_argv; -char **_envp; - /* * Prototypes. */ -void reload(void); void sighup(void); void sigint(void); void sigterm(void); void sigusr1(void); -void -reload () -{ - zlog_debug ("Reload"); - /* FIXME: Clean up func call here */ - vty_reset (); - (void) isisd_privs.change (ZPRIVS_RAISE); - execve (_progpath, _argv, _envp); - zlog_err ("Reload failed: cannot exec %s: %s", _progpath, - safe_strerror (errno)); -} - static __attribute__((__noreturn__)) void terminate (int i) { @@ -131,9 +111,7 @@ terminate (int i) void sighup (void) { - zlog_debug ("SIGHUP received"); - reload (); - + zlog_err ("SIGHUP/reload is not implemented for isisd"); return; } @@ -199,21 +177,6 @@ main (int argc, char **argv, char **envp) { int opt; - /* for reload */ - _argc = argc; - _argv = argv; - _envp = envp; - if (getcwd (_cwd, sizeof (_cwd)) == NULL) - { - zlog_err ("ISISd: Unable to determine CWD: %d", errno); - exit (1); - } - - if (*argv[0] == '.') - snprintf (_progpath, sizeof (_progpath), "%s/%s", _cwd, _argv[0]); - else - snprintf (_progpath, sizeof (_progpath), "%s", argv[0]); - frr_preinit (&isisd_di, argc, argv); frr_opt_add ("", longopts, ""); From 4487fc74e8e4ddbf5cde6c3b0a83db3eb828ee11 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Wed, 8 Mar 2017 16:13:12 +0100 Subject: [PATCH 3/5] *: fix some user-visible Quagga remnants (Note: the allow_delete thing is called "zebra" on the commandline because that's the clearest context there, while it is called "FRR" in the CLI because that's considerably less confusing in a vtysh env.) Signed-off-by: David Lamparter --- lib/log.h | 2 -- pimd/pim_main.c | 3 --- zebra/main.c | 2 +- zebra/test_main.c | 2 +- zebra/zebra_vty.c | 4 ++-- 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/log.h b/lib/log.h index 8a65bbbf51..cc419cc374 100644 --- a/lib/log.h +++ b/lib/log.h @@ -153,8 +153,6 @@ struct timestamp_control { char buf[QUAGGA_TIMESTAMP_LEN]; /* will contain the rendered timestamp */ }; -#define LOG_DEFAULT_FILENAME "/var/log/quagga/Quagga.log" - /* Defines for use in command construction: */ #define LOG_LEVEL_DESC \ diff --git a/pimd/pim_main.c b/pimd/pim_main.c index ba1c511d16..a0e42aab58 100644 --- a/pimd/pim_main.c +++ b/pimd/pim_main.c @@ -113,9 +113,6 @@ int main(int argc, char** argv, char** envp) { master = frr_init(); - zlog_notice("Quagga %s " PIMD_PROGNAME " %s starting", - FRR_VERSION, PIMD_VERSION); - /* * Initializations */ diff --git a/zebra/main.c b/zebra/main.c index b70ce7eda7..98177a423e 100644 --- a/zebra/main.c +++ b/zebra/main.c @@ -229,7 +229,7 @@ main (int argc, char **argv) #endif , longopts, " -b, --batch Runs in batch mode\n" - " -a, --allow_delete Allow other processes to delete Quagga Routes\n" + " -a, --allow_delete Allow other processes to delete zebra routes\n" " -F, --fpm_format Set fpm format to 'netlink' or 'protobuf'\n" " -z, --socket Set path of zebra socket\n" " -e, --ecmp Specify ECMP to use.\n" diff --git a/zebra/test_main.c b/zebra/test_main.c index a80b4c87c4..f3ef3df96a 100644 --- a/zebra/test_main.c +++ b/zebra/test_main.c @@ -100,7 +100,7 @@ usage (char *progname, int status) "redistribution between different routing protocols.\n\n"\ "-b, --batch Runs in batch mode\n"\ "-d, --daemon Runs in daemon mode\n"\ - "-a, --allow_delete Allow other processes to delete Quagga Routes\n" \ + "-a, --allow_delete Allow other processes to delete zebra routes\n" \ "-f, --config_file Set configuration file name\n"\ "-A, --vty_addr Set vty's bind address\n"\ "-P, --vty_port Set vty's port number\n"\ diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index ddb037335c..7946089aea 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -3825,7 +3825,7 @@ static_config_ipv6 (struct vty *vty) DEFUN (allow_external_route_update, allow_external_route_update_cmd, "allow-external-route-update", - "Allow Quagga routes to be overwritten by external processes") + "Allow FRR routes to be overwritten by external processes") { allow_delete = 1; @@ -3835,7 +3835,7 @@ DEFUN (allow_external_route_update, DEFUN (no_allow_external_route_update, no_allow_external_route_update_cmd, "no allow-external-route-update", - "Allow Quagga routes to be overwritten by external processes") + "Allow FRR routes to be overwritten by external processes") { allow_delete = 0; From 9272302b003fdc1090045b809d38185b1ecab72b Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Wed, 8 Mar 2017 16:22:43 +0100 Subject: [PATCH 4/5] watchfrr: make min/max restart interval longopts -m/-M seem to be seldomly used... ... and I kindof need/want -M for module loading. Signed-off-by: David Lamparter --- watchfrr/watchfrr.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/watchfrr/watchfrr.c b/watchfrr/watchfrr.c index 413a631005..6edce242b3 100644 --- a/watchfrr/watchfrr.c +++ b/watchfrr/watchfrr.c @@ -174,6 +174,9 @@ struct daemon { struct restart_info restart; }; +#define OPTION_MINRESTART 2000 +#define OPTION_MAXRESTART 2001 + static const struct option longopts[] = { {"daemon", no_argument, NULL, 'd'}, {"statedir", required_argument, NULL, 'S'}, @@ -189,8 +192,8 @@ static const struct option longopts[] = { {"all-restart", no_argument, NULL, 'a'}, {"always-all-restart", no_argument, NULL, 'A'}, {"unresponsive-restart", no_argument, NULL, 'z'}, - {"min-restart-interval", required_argument, NULL, 'm'}, - {"max-restart-interval", required_argument, NULL, 'M'}, + {"min-restart-interval", required_argument, NULL, OPTION_MINRESTART }, + {"max-restart-interval", required_argument, NULL, OPTION_MAXRESTART }, {"pid-file", required_argument, NULL, 'p'}, {"blank-string", required_argument, NULL, 'b'}, {"help", no_argument, NULL, 'h'}, @@ -263,10 +266,10 @@ Otherwise, the interval is doubled (but capped at the -M value).\n\n", progname, The value should range from %d (LOG_EMERG) to %d (LOG_DEBUG),\n\ but it can be set higher than %d if extra-verbose debugging\n\ messages are desired.\n\ --m, --min-restart-interval\n\ + --min-restart-interval\n\ Set the minimum seconds to wait between invocations of daemon\n\ restart commands (default is %d).\n\ --M, --max-restart-interval\n\ + --max-restart-interval\n\ Set the maximum seconds to wait between invocations of daemon\n\ restart commands (default is %d).\n\ -i, --interval Set the status polling interval in seconds (default is %d)\n\ @@ -1044,7 +1047,7 @@ int main(int argc, char **argv) frr_preinit(&watchfrr_di, argc, argv); progname = watchfrr_di.progname; - frr_opt_add("aAb:dek:l:m:M:i:p:r:R:S:s:t:T:z", longopts, ""); + frr_opt_add("aAb:dek:l:i:p:r:R:S:s:t:T:z", longopts, ""); gs.restart.name = "all"; while ((opt = frr_getopt(argc, argv, NULL)) != EOF) { @@ -1098,7 +1101,7 @@ int main(int argc, char **argv) } } break; - case 'm': + case OPTION_MINRESTART: { char garbage[3]; if ((sscanf(optarg, "%ld%1s", @@ -1112,7 +1115,7 @@ int main(int argc, char **argv) } } break; - case 'M': + case OPTION_MAXRESTART: { char garbage[3]; if ((sscanf(optarg, "%ld%1s", From 6a5e07e0c60b93fdc2ccb076a3ee3d20ef05453e Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Wed, 8 Mar 2017 16:37:42 +0100 Subject: [PATCH 5/5] pimd: fix clang warning pimd/pim_sock.c:178:13: error: implicit conversion from 'int' to 'char' changes value from 148 to -108 [-Werror,-Wconstant-conversion] ra[0] = 148; Signed-off-by: David Lamparter --- pimd/pim_sock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pimd/pim_sock.c b/pimd/pim_sock.c index 7f62a1e9dc..07b137bb51 100644 --- a/pimd/pim_sock.c +++ b/pimd/pim_sock.c @@ -174,7 +174,7 @@ int pim_socket_mcast(int protocol, struct in_addr ifaddr, struct interface *ifp, /* Set router alert (RFC 2113) for all IGMP messages (RFC 3376 4. Message Formats)*/ if (protocol == IPPROTO_IGMP) { - char ra[4]; + uint8_t ra[4]; ra[0] = 148; ra[1] = 4; ra[2] = 0;