From 87362ceb5d493f12e8c937b533190a1996d2df22 Mon Sep 17 00:00:00 2001 From: Denis Ovsienko Date: Sat, 27 Aug 2011 22:19:34 +0400 Subject: ospf6d: address more trivial compiler warnings * ospf6_main.c: include required headers * ospf6_asbr.h: idem * ospf6_spf.c * ospf6_spf_install(): remove unused variables --- ospf6d/ospf6_main.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ospf6d/ospf6_main.c') diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c index 800fae4b..0e613152 100644 --- a/ospf6d/ospf6_main.c +++ b/ospf6d/ospf6_main.c @@ -34,8 +34,13 @@ #include "plist.h" #include "privs.h" #include "sigevent.h" +#include "zclient.h" #include "ospf6d.h" +#include "ospf6_top.h" +#include "ospf6_message.h" +#include "ospf6_asbr.h" +#include "ospf6_lsa.h" /* Default configuration file name for ospf6d. */ #define OSPF6_DEFAULT_CONFIG "ospf6d.conf" -- cgit v1.2.1 From c143c38bc707194d52aec544e62e5485c6c4bc08 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 7 Dec 2011 01:25:46 +0400 Subject: ospf6d: fix compile warning from falling off end of main ospf6 main always calls ospf6_exit() which always calls exit. Use attributes to tell GCC that this is ok. --- ospf6d/ospf6_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ospf6d/ospf6_main.c') diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c index 0e613152..6f7717c8 100644 --- a/ospf6d/ospf6_main.c +++ b/ospf6d/ospf6_main.c @@ -129,7 +129,7 @@ Report bugs to zebra@zebra.org\n", progname); exit (status); } -static void +static void __attribute__ ((noreturn)) ospf6_exit (int status) { extern struct ospf6 *ospf6; -- cgit v1.2.1 From b51146856e660bcec723f535c17dc1c38b2f6efc Mon Sep 17 00:00:00 2001 From: Vyacheslav Trushkin Date: Fri, 25 Nov 2011 18:51:48 +0400 Subject: quagga: option "-z" ("--socket ") added All daemons modified to support custom path to zserv socket. lib: generalize a zclient connection zclient_socket_connect added. zclient_socket and zclient_socket_un were hidden under static expression. "zclient_serv_path_set" modified. --- ospf6d/ospf6_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'ospf6d/ospf6_main.c') diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c index 6f7717c8..c4b9124e 100644 --- a/ospf6d/ospf6_main.c +++ b/ospf6d/ospf6_main.c @@ -77,6 +77,7 @@ struct option longopts[] = { "daemon", no_argument, NULL, 'd'}, { "config_file", required_argument, NULL, 'f'}, { "pid_file", required_argument, NULL, 'i'}, + { "socket", required_argument, NULL, 'z'}, { "vty_addr", required_argument, NULL, 'A'}, { "vty_port", required_argument, NULL, 'P'}, { "user", required_argument, NULL, 'u'}, @@ -115,6 +116,7 @@ Daemon which manages OSPF version 3.\n\n\ -d, --daemon Runs in daemon mode\n\ -f, --config_file Set configuration file name\n\ -i, --pid_file Set process identifier file name\n\ +-z, --socket Set path of zebra socket\n\ -A, --vty_addr Set vty's bind address\n\ -P, --vty_port Set vty's port number\n\ -u, --user User to run as\n\ @@ -231,7 +233,7 @@ main (int argc, char *argv[], char *envp[]) /* Command line argument treatment. */ while (1) { - opt = getopt_long (argc, argv, "df:i:hp:A:P:u:g:vC", longopts, 0); + opt = getopt_long (argc, argv, "df:i:z:hp:A:P:u:g:vC", longopts, 0); if (opt == EOF) break; @@ -252,6 +254,9 @@ main (int argc, char *argv[], char *envp[]) case 'i': pid_file = optarg; break; + case 'z': + zclient_serv_path_set (optarg); + break; case 'P': /* Deal with atoi() returning 0 on failure, and ospf6d not listening on ospf6d port... */ -- cgit v1.2.1 From 6fd16207fee6d4d09f29ed7ecf26303a7220e473 Mon Sep 17 00:00:00 2001 From: Vyacheslav Trushkin Date: Tue, 20 Dec 2011 20:52:31 +0400 Subject: ospf6d: add verifying user's privileges --- ospf6d/ospf6_main.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'ospf6d/ospf6_main.c') diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c index c4b9124e..d40bd97f 100644 --- a/ospf6d/ospf6_main.c +++ b/ospf6d/ospf6_main.c @@ -291,6 +291,13 @@ main (int argc, char *argv[], char *envp[]) } } + if (geteuid () != 0) + { + errno = EPERM; + perror (progname); + exit (1); + } + /* thread master */ master = thread_master_create (); -- cgit v1.2.1 From ef2d5d100431031c32ea35b3c834b46cff16f511 Mon Sep 17 00:00:00 2001 From: Phil Laverdiere Date: Mon, 2 Jan 2012 20:04:26 +0400 Subject: ospf6d: remove own routes on SIGTERM (BZ#448) --- ospf6d/ospf6_main.c | 1 + 1 file changed, 1 insertion(+) (limited to 'ospf6d/ospf6_main.c') diff --git a/ospf6d/ospf6_main.c b/ospf6d/ospf6_main.c index d40bd97f..d3ef0a6a 100644 --- a/ospf6d/ospf6_main.c +++ b/ospf6d/ospf6_main.c @@ -180,6 +180,7 @@ static void sigterm (void) { zlog_notice ("Terminating on signal SIGTERM"); + ospf6_clean(); ospf6_exit (0); } -- cgit v1.2.1