From 363591508db8f17045c9159522ad9511e63cba2e Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Mon, 23 Sep 2013 14:20:27 -0700 Subject: [PATCH] stream: Log a warning when the default OpenFlow or OVSDB port is used. Both OpenFlow and OVSDB have new IANA-assigned port numbers. We still default to the original values (6633 and 6632, respectively), but this commit logs a warning. In the future, we will switch to the official values (6653 and 6640, respectively). Signed-off-by: Justin Pettit Acked-by: Ben Pfaff --- NEWS | 4 ++++ lib/stream.c | 13 +++++++++++++ 2 files changed, 17 insertions(+) diff --git a/NEWS b/NEWS index eae1146dc..94e0da9c1 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,9 @@ Post-v2.0.0 --------------------- + - The default OpenFlow and OVSDB ports will change to + IANA-assigned numbers in a future release. Consider updating + your installations to specify port numbers instead of using the + defaults. v2.0.0 - xx xxx xxxx diff --git a/lib/stream.c b/lib/stream.c index 5bf42ce87..0442d84e0 100644 --- a/lib/stream.c +++ b/lib/stream.c @@ -26,6 +26,7 @@ #include "dynamic-string.h" #include "fatal-signal.h" #include "flow.h" +#include "jsonrpc.h" #include "ofp-print.h" #include "ofpbuf.h" #include "openflow/nicira-ext.h" @@ -34,6 +35,9 @@ #include "poll-loop.h" #include "random.h" #include "util.h" +#include "vlog.h" + +VLOG_DEFINE_THIS_MODULE(stream); COVERAGE_DEFINE(pstream_open); COVERAGE_DEFINE(stream_open); @@ -727,6 +731,15 @@ stream_open_with_default_port(const char *name_, if ((!strncmp(name_, "tcp:", 4) || !strncmp(name_, "ssl:", 4)) && count_fields(name_) < 3) { + if (default_port == OFP_OLD_PORT) { + VLOG_WARN_ONCE("The default OpenFlow port number will change " + "from %d to %d in a future release", + OFP_OLD_PORT, OFP_PORT); + } else if (default_port == OVSDB_OLD_PORT) { + VLOG_WARN_ONCE("The default OVSDB port number will change " + "from %d to %d in a future release", + OVSDB_OLD_PORT, OVSDB_PORT); + } name = xasprintf("%s:%d", name_, default_port); } else { name = xstrdup(name_); -- 2.43.0