From 527f4338f42e774807b8461f11978b11b3fe8de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E7=A5=96=E5=BB=BA?= Date: Sat, 25 May 2024 05:15:59 +0000 Subject: [PATCH] listen on tcp 127.0.0.1:6643 by default --- lib/db-ctl-base.c | 3 ++- ovsdb/ovsdb-client.c | 6 +++--- vswitchd/ovs-vswitchd.c | 7 ++++--- windows/ovs-windows-installer/CustomActions.wxs | 2 +- windows/ovs-windows-installer/Product.wxs | 4 ++-- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/lib/db-ctl-base.c b/lib/db-ctl-base.c index 3a8068b12c0..d3a8506d676 100644 --- a/lib/db-ctl-base.c +++ b/lib/db-ctl-base.c @@ -28,6 +28,7 @@ #include "openvswitch/dynamic-string.h" #include "fatal-signal.h" #include "hash.h" +#include "jsonrpc.h" #include "openvswitch/json.h" #include "openvswitch/vlog.h" #include "ovsdb-data.h" @@ -2421,7 +2422,7 @@ ctl_default_db(void) { static char *def; if (!def) { - def = xasprintf("unix:%s/db.sock", ovs_rundir()); + def = xasprintf("tcp:127.0.0.1:%d", OVSDB_PORT); } return def; } diff --git a/ovsdb/ovsdb-client.c b/ovsdb/ovsdb-client.c index cf2ecfd08a9..707cf978cb7 100644 --- a/ovsdb/ovsdb-client.c +++ b/ovsdb/ovsdb-client.c @@ -116,7 +116,7 @@ struct jsonrpc_msg *create_database_info_request(const char *database); static char * default_remote(void) { - return xasprintf("unix:%s/db.sock", ovs_rundir()); + return xasprintf("ptcp:%d:127.0.0.1", OVSDB_PORT); } static int @@ -464,9 +464,9 @@ usage(void) " steal LOCK from SERVER\n" "\n unlock [SERVER] LOCK\n" " unlock LOCK from SERVER\n" - "\nThe default SERVER is unix:%s/db.sock.\n" + "\nThe default SERVER is tcp:127.0.0.1:%d.\n" "The default DATABASE is Open_vSwitch.\n", - program_name, program_name, ovs_rundir()); + program_name, program_name, OVSDB_PORT); stream_usage("SERVER", true, true, true); table_usage(); printf(" --timestamp timestamp \"monitor\" output"); diff --git a/vswitchd/ovs-vswitchd.c b/vswitchd/ovs-vswitchd.c index 273af9f5d62..903b9b22a9d 100644 --- a/vswitchd/ovs-vswitchd.c +++ b/vswitchd/ovs-vswitchd.c @@ -33,6 +33,7 @@ #include "dpif.h" #include "dummy.h" #include "fatal-signal.h" +#include "jsonrpc.h" #include "memory.h" #include "netdev.h" #include "openflow/openflow.h" @@ -273,7 +274,7 @@ parse_options(int argc, char *argv[], char **unixctl_pathp) switch (argc) { case 0: - return xasprintf("unix:%s/db.sock", ovs_rundir()); + return xasprintf("tcp:127.0.0.1:%d", OVSDB_PORT); case 1: return xstrdup(argv[0]); @@ -290,8 +291,8 @@ usage(void) printf("%s: Open vSwitch daemon\n" "usage: %s [OPTIONS] [DATABASE]\n" "where DATABASE is a socket on which ovsdb-server is listening\n" - " (default: \"unix:%s/db.sock\").\n", - program_name, program_name, ovs_rundir()); + " (default: \"tcp:127.0.0.1:%d\").\n", + program_name, program_name, OVSDB_PORT); stream_usage("DATABASE", true, false, true); daemon_usage(); vlog_usage(); diff --git a/windows/ovs-windows-installer/CustomActions.wxs b/windows/ovs-windows-installer/CustomActions.wxs index cc1b80eff5f..49e3233acac 100644 --- a/windows/ovs-windows-installer/CustomActions.wxs +++ b/windows/ovs-windows-installer/CustomActions.wxs @@ -33,7 +33,7 @@ JScriptCall="runCommandAction" Execute="deferred" Return="check" Impersonate="no" />