From 5c88f19d5b166c6afa8a9b8501badb785afa553b Mon Sep 17 00:00:00 2001 From: Chris Luke Date: Tue, 18 Oct 2011 17:26:51 +0400 Subject: bgpd: justify capabilities for TOS setting To set the TOS bits on TCP connections, platforms that restrict capabilities need the priv level to be raised before the sockopt is set, and this requires the ZCAP_NET_ADMIN priv. * bgp_main.c: update _caps_p to include ZCAP_NET_ADMIN * bgp_network.c * bgp_connect(): request ZPRIVS_RAISE/ZPRIVS_LOWER * bgp_listener(): request ZPRIVS_RAISE earlier --- bgpd/bgp_main.c | 1 + 1 file changed, 1 insertion(+) (limited to 'bgpd/bgp_main.c') diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c index 1a460c6b..0e85d57e 100644 --- a/bgpd/bgp_main.c +++ b/bgpd/bgp_main.c @@ -119,6 +119,7 @@ static zebra_capabilities_t _caps_p [] = { ZCAP_BIND, ZCAP_NET_RAW, + ZCAP_NET_ADMIN, }; struct zebra_privs_t bgpd_privs = -- cgit v1.2.1 From 04d5e24d7425a52f13abcb6d2a30aa6246d837e7 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 7 Dec 2011 00:04:46 +0400 Subject: bgpd: cleanup privs on termination When doing valgrind testing, the privledges from zprivs_init() need to be cleaned up on exit. --- bgpd/bgp_main.c | 1 + 1 file changed, 1 insertion(+) (limited to 'bgpd/bgp_main.c') diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c index 0e85d57e..822805ce 100644 --- a/bgpd/bgp_main.c +++ b/bgpd/bgp_main.c @@ -197,6 +197,7 @@ sigint (void) if (! retain_mode) bgp_terminate (); + zprivs_terminate (&bgpd_privs); bgp_exit (0); } -- 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. --- bgpd/bgp_main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'bgpd/bgp_main.c') diff --git a/bgpd/bgp_main.c b/bgpd/bgp_main.c index 822805ce..8dede587 100644 --- a/bgpd/bgp_main.c +++ b/bgpd/bgp_main.c @@ -54,6 +54,7 @@ static const 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'}, { "bgp_port", required_argument, NULL, 'p'}, { "listenon", required_argument, NULL, 'l'}, { "vty_addr", required_argument, NULL, 'A'}, @@ -150,6 +151,7 @@ redistribution between different routing protocols.\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\ -p, --bgp_port Set bgp protocol's port number\n\ -l, --listenon Listen on specified address (implies -n)\n\ -A, --vty_addr Set vty's bind address\n\ @@ -337,7 +339,7 @@ main (int argc, char **argv) /* Command line argument treatment. */ while (1) { - opt = getopt_long (argc, argv, "df:i:hp:l:A:P:rnu:g:vC", longopts, 0); + opt = getopt_long (argc, argv, "df:i:z:hp:l:A:P:rnu:g:vC", longopts, 0); if (opt == EOF) break; @@ -355,6 +357,9 @@ main (int argc, char **argv) case 'i': pid_file = optarg; break; + case 'z': + zclient_serv_path_set (optarg); + break; case 'p': tmp_port = atoi (optarg); if (tmp_port <= 0 || tmp_port > 0xffff) -- cgit v1.2.1