vconn: Make errors in vconn names non-fatal errors.
[openvswitch] / lib / vconn-ssl.c
index 607d9b9e7310a289d1f1eb03b9f465cb16a90516..a7060d74bb9a91e4f1bd7c80829437a9b4132a1a 100644 (file)
@@ -270,7 +270,8 @@ ssl_open(const char *name, char *suffix, struct vconn **vconnp)
     host_name = strtok_r(suffix, "::", &save_ptr);
     port_string = strtok_r(NULL, "::", &save_ptr);
     if (!host_name) {
-        fatal(0, "%s: bad peer name format", name);
+        error(0, "%s: bad peer name format", name);
+        return EAFNOSUPPORT;
     }
 
     memset(&sin, 0, sizeof sin);
@@ -867,6 +868,13 @@ tmp_dh_callback(SSL *ssl, int is_export UNUSED, int keylength)
     return NULL;
 }
 
+/* Returns true if SSL is at least partially configured. */
+bool
+vconn_ssl_is_configured(void) 
+{
+    return has_private_key || has_certificate || has_ca_cert;
+}
+
 void
 vconn_ssl_set_private_key_file(const char *file_name)
 {