X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ovsdb%2Fovsdb-server.c;h=900f4eccb1e63e58650cc2ec214b1d9b41a7513c;hb=63f08492f42c3095423b9c71c79904d6cad1126d;hp=9250914fa07542ce8cc5aaba95e5aacdbaa8643b;hpb=0b1fae1b73c4c6cfc84edafc6845a17257191e42;p=openvswitch diff --git a/ovsdb/ovsdb-server.c b/ovsdb/ovsdb-server.c index 9250914f..900f4ecc 100644 --- a/ovsdb/ovsdb-server.c +++ b/ovsdb/ovsdb-server.c @@ -25,7 +25,6 @@ #include "column.h" #include "command-line.h" #include "daemon.h" -#include "fault.h" #include "file.h" #include "json.h" #include "jsonrpc.h" @@ -38,6 +37,7 @@ #include "poll-loop.h" #include "process.h" #include "row.h" +#include "stream-ssl.h" #include "stream.h" #include "svec.h" #include "table.h" @@ -71,8 +71,8 @@ main(int argc, char *argv[]) bool exiting; int retval; + proctitle_init(argc, argv); set_program_name(argv[0]); - register_fault_handlers(); time_init(); vlog_init(); signal(SIGPIPE, SIG_IGN); @@ -93,7 +93,7 @@ main(int argc, char *argv[]) retval = unixctl_server_create(unixctl_path, &unixctl); if (retval) { - ovs_fatal(retval, "could not listen for control connections"); + exit(EXIT_FAILURE); } daemonize_complete(); @@ -161,6 +161,8 @@ query_db_remotes(const char *name_, const struct ovsdb *db, shash_add_once(remotes, datum->keys[i].string, NULL); } } + + free(name); } static void @@ -202,6 +204,7 @@ parse_options(int argc, char *argv[], char **file_namep, OPT_DUMMY = UCHAR_MAX + 1, OPT_REMOTE, OPT_UNIXCTL, + OPT_BOOTSTRAP_CA_CERT, VLOG_OPTION_ENUMS, LEAK_CHECKER_OPTION_ENUMS }; @@ -213,6 +216,10 @@ parse_options(int argc, char *argv[], char **file_namep, DAEMON_LONG_OPTIONS, VLOG_LONG_OPTIONS, LEAK_CHECKER_LONG_OPTIONS, +#ifdef HAVE_OPENSSL + {"bootstrap-ca-cert", required_argument, 0, OPT_BOOTSTRAP_CA_CERT}, + STREAM_SSL_LONG_OPTIONS +#endif {0, 0, 0, 0}, }; char *short_options = long_options_to_short_options(long_options); @@ -246,6 +253,15 @@ parse_options(int argc, char *argv[], char **file_namep, DAEMON_OPTION_HANDLERS LEAK_CHECKER_OPTION_HANDLERS +#ifdef HAVE_OPENSSL + STREAM_SSL_OPTION_HANDLERS + + case OPT_BOOTSTRAP_CA_CERT: + stream_ssl_set_ca_cert_file(optarg, true); + break; +#endif + + case '?': exit(EXIT_FAILURE); @@ -277,7 +293,7 @@ usage(void) program_name, program_name); printf("\nJSON-RPC options (may be specified any number of times):\n" " --remote=REMOTE connect or listen to REMOTE\n"); - stream_usage("JSON-RPC", true, true); + stream_usage("JSON-RPC", true, true, true); daemon_usage(); vlog_usage(); printf("\nOther options:\n"