stream: Log a warning when the default OpenFlow or OVSDB port is used.
authorJustin Pettit <jpettit@nicira.com>
Mon, 23 Sep 2013 21:20:27 +0000 (14:20 -0700)
committerJustin Pettit <jpettit@nicira.com>
Tue, 1 Oct 2013 23:46:40 +0000 (16:46 -0700)
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 <jpettit@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
NEWS
lib/stream.c

diff --git a/NEWS b/NEWS
index eae1146..94e0da9 100644 (file)
--- 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
index 5bf42ce..0442d84 100644 (file)
@@ -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_);