From 436cf33bb74f422ef3fe02527eeebf6b0817fa04 Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Fri, 13 Nov 2009 15:51:44 -0800 Subject: [PATCH] ovs-openflowd: Setup default listener By default, ovs-openflowd was not listening for any management connections. Tools such as ovs-ofctl attempt to use a default location based on the datapath name. This change creates that default listener. --- utilities/ovs-openflowd.8.in | 11 ++++++++--- utilities/ovs-openflowd.c | 6 ++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/utilities/ovs-openflowd.8.in b/utilities/ovs-openflowd.8.in index 3d255746..312e7f73 100644 --- a/utilities/ovs-openflowd.8.in +++ b/utilities/ovs-openflowd.8.in @@ -298,11 +298,16 @@ time is 8 seconds. .TP \fB-l\fR, \fB--listen=\fImethod\fR -Configures the switch to additionally listen for incoming OpenFlow -connections for switch management with \fBovs\-ofctl\fR. The \fImethod\fR +By default, the switch listens for OpenFlow management connections on a +Unix domain socket named \fB@RUNDIR@/\fIdatapath\fB.mgmt\fR. This socket +can be used to perform local OpenFlow monitoring and administration with +tools such as \fBovs\-ofctl\fR. + +This option may be used to override the default listener. The \fImethod\fR must be given as one of the passive OpenFlow connection methods listed below. This option may be specified multiple times to listen to -multiple connection methods. +multiple connection methods. If a single \fImethod\fR of \fBnone\fR is +used, no listeners will be created. .RS .TP diff --git a/utilities/ovs-openflowd.c b/utilities/ovs-openflowd.c index 20da572b..d6b2c51f 100644 --- a/utilities/ovs-openflowd.c +++ b/utilities/ovs-openflowd.c @@ -156,6 +156,12 @@ main(int argc, char *argv[]) ofproto_set_mgmt_id(ofproto, s.mgmt_id); } ofproto_set_desc(ofproto, s.mfr_desc, s.hw_desc, s.sw_desc, s.serial_desc); + if (!s.listeners.n) { + svec_add_nocopy(&s.listeners, xasprintf("punix:%s/%s.mgmt", + ovs_rundir, s.dp_name)); + } else if (s.listeners.n == 1 && !strcmp(s.listeners.names[0], "none")) { + svec_clear(&s.listeners); + } error = ofproto_set_listeners(ofproto, &s.listeners); if (error) { ovs_fatal(error, "failed to configure management connections"); -- 2.30.2