stream-ssl: Fix misleading bound address format.
authorBen Pfaff <blp@ovn.org>
Sat, 19 Dec 2015 06:09:57 +0000 (22:09 -0800)
committerBen Pfaff <blp@ovn.org>
Mon, 21 Dec 2015 22:11:10 +0000 (14:11 -0800)
When the SSL code presents the name of the address to which it is bound,
it should include an "ssl:" or "pssl:" prefix instead of "tcp:" or "ptcp:".

Reported-by: meishengxin <meishengxin@huawei.com>
Reported-at: http://openvswitch.org/pipermail/discuss/2015-December/019694.html
Fixes: e731d71bf47b ("Add IPv6 support for OpenFlow, OVSDB, NetFlow, and sFlow.")
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Russell Bryant <russell@ovn.org>
AUTHORS
lib/stream-ssl.c

diff --git a/AUTHORS b/AUTHORS
index 5a3e826..e8d17ac 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -412,6 +412,7 @@ ankur dwivedi           ankurengg2003@gmail.com
 chen zhang              3zhangchen9211@gmail.com
 kk yap                  yapkke@stanford.edu
 likunyun                kunyunli@hotmail.com
+meishengxin             meishengxin@huawei.com
 neeraj mehta            mehtaneeraj07@gmail.com
 rahim entezari          rahim.entezari@gmail.com
 俊 赵                    zhaojun12@outlook.com
index 0e1c8b5..f82c319 100644 (file)
@@ -806,7 +806,7 @@ pssl_open(const char *name OVS_UNUSED, char *suffix, struct pstream **pstreamp,
     }
 
     port = ss_get_port(&ss);
-    snprintf(bound_name, sizeof bound_name, "ptcp:%"PRIu16":%s",
+    snprintf(bound_name, sizeof bound_name, "pssl:%"PRIu16":%s",
              port, ss_format_address(&ss, addrbuf, sizeof addrbuf));
 
     pssl = xmalloc(sizeof *pssl);
@@ -856,7 +856,7 @@ pssl_accept(struct pstream *pstream, struct stream **new_streamp)
         return error;
     }
 
-    snprintf(name, sizeof name, "tcp:%s:%"PRIu16,
+    snprintf(name, sizeof name, "ssl:%s:%"PRIu16,
              ss_format_address(&ss, addrbuf, sizeof addrbuf),
              ss_get_port(&ss));
     return new_ssl_stream(name, new_fd, SERVER, STATE_SSL_CONNECTING,