Skip to content

Commit

Permalink
listen on tcp 127.0.0.1:6643 by default
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzujian committed May 7, 2022
1 parent 08a95db commit 680e77a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
3 changes: 2 additions & 1 deletion lib/db-ctl-base.c
Expand Up @@ -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"
Expand Down Expand Up @@ -2392,7 +2393,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;
}
Expand Down
6 changes: 3 additions & 3 deletions ovsdb/ovsdb-client.c
Expand Up @@ -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
Expand Down Expand Up @@ -463,9 +463,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");
Expand Down
7 changes: 4 additions & 3 deletions vswitchd/ovs-vswitchd.c
Expand Up @@ -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"
Expand Down Expand Up @@ -260,7 +261,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]);
Expand All @@ -277,8 +278,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();
Expand Down
2 changes: 1 addition & 1 deletion windows/ovs-windows-installer/CustomActions.wxs
Expand Up @@ -33,7 +33,7 @@
JScriptCall="runCommandAction" Execute="deferred" Return="check" Impersonate="no" />

<CustomAction Id="InitializeDB_Prop" Property="InitializeDB"
Value='"[BINARIESDIR]ovs-vsctl.exe" --no-wait --db=unix:"[APPDATADIR]db.sock" init|0|ovs-vsctl failed to initialize the database'
Value='"[BINARIESDIR]ovs-vsctl.exe" --no-wait --db=tcp:127.0.0.1:6640 init|0|ovs-vsctl failed to initialize the database'
Execute="immediate" />
<CustomAction Id="InitializeDB"
BinaryKey="OVSActions"
Expand Down
4 changes: 2 additions & 2 deletions windows/ovs-windows-installer/Product.wxs
Expand Up @@ -189,7 +189,7 @@
<Component Id="OvsdbServerService" Directory="BINARIESDIR" Guid="{280201D5-35E7-45D6-83B9-293F1A4F7F0E}">
<File Id="ovsdbserver.exe" Source="Services\ovsdb-server.exe" Checksum="yes" />
<ServiceInstall
Arguments='--log-file="[LOGSDIR]ovsdb-server.log" --pidfile="[APPDATADIR]ovsdb-server.pid" --service --service-monitor --unixctl="[APPDATADIR]ovsdb-server.ctl" --remote=punix:"[APPDATADIR]db.sock" "[CONFDIR]conf.db"'
Arguments='--log-file="[LOGSDIR]ovsdb-server.log" --pidfile="[APPDATADIR]ovsdb-server.pid" --service --service-monitor --unixctl="[APPDATADIR]ovsdb-server.ctl" --remote=ptcp:6640:127.0.0.1 "[CONFDIR]conf.db"'
Id="OvsdbServerServiceInstaller"
Type="ownProcess"
Vital="yes"
Expand Down Expand Up @@ -220,7 +220,7 @@
<Component Id="OvsVSwitchdService" Directory="BINARIESDIR" Guid="{A2ED5531-B2D7-4CD3-8ADE-B525A8BEB957}">
<File Id="ovsvswitchd.exe" Source="Services\ovs-vswitchd.exe" Checksum="yes" />
<ServiceInstall
Arguments='--log-file="[LOGSDIR]ovs-vswitchd.log" unix:"[APPDATADIR]db.sock" --unixctl="[APPDATADIR]ovs-vswitchd.ctl" --pidfile="[APPDATADIR]ovs-vswitchd.pid" --service --service-monitor'
Arguments='--log-file="[LOGSDIR]ovs-vswitchd.log" tcp:127.0.0.1:6640 --unixctl="[APPDATADIR]ovs-vswitchd.ctl" --pidfile="[APPDATADIR]ovs-vswitchd.pid" --service --service-monitor'
Id="OvsVSwitchdServiceServiceInstaller"
Type="ownProcess"
Vital="yes"
Expand Down

0 comments on commit 680e77a

Please sign in to comment.