datapath: Replace "struct odp_action" by Netlink attributes.
[sliver-openvswitch.git] / lib / stream-ssl.c
index a633587..1fc7446 100644 (file)
 #include "timeval.h"
 #include "vlog.h"
 
-VLOG_DEFINE_THIS_MODULE(stream_ssl)
+VLOG_DEFINE_THIS_MODULE(stream_ssl);
+
+COVERAGE_DEFINE(ssl_session);
+COVERAGE_DEFINE(ssl_session_reused);
 
 /* Active SSL. */
 
@@ -385,7 +388,7 @@ do_ca_cert_bootstrap(struct stream *stream)
 
     file = fdopen(fd, "w");
     if (!file) {
-        int error = errno;
+        error = errno;
         VLOG_ERR("could not bootstrap CA cert: fdopen failed: %s",
                  strerror(error));
         unlink(ca_cert.file_name);
@@ -402,7 +405,7 @@ do_ca_cert_bootstrap(struct stream *stream)
     }
 
     if (fclose(file)) {
-        int error = errno;
+        error = errno;
         VLOG_ERR("could not bootstrap CA cert: writing %s failed: %s",
                  ca_cert.file_name, strerror(error));
         unlink(ca_cert.file_name);
@@ -921,7 +924,7 @@ pssl_accept(struct pstream *pstream, struct stream **new_streamp)
 
     new_fd = accept(pssl->fd, &sin, &sin_len);
     if (new_fd < 0) {
-        int error = errno;
+        error = errno;
         if (error != EAGAIN) {
             VLOG_DBG_RL(&rl, "accept: %s", strerror(error));
         }
@@ -988,7 +991,9 @@ do_ssl_init(void)
     SSL_library_init();
     SSL_load_error_strings();
 
-    method = TLSv1_method();
+    /* New OpenSSL changed TLSv1_method() to return a "const" pointer, so the
+     * cast is needed to avoid a warning with those newer versions. */
+    method = (SSL_METHOD *) TLSv1_method();
     if (method == NULL) {
         VLOG_ERR("TLSv1_method: %s", ERR_error_string(ERR_get_error(), NULL));
         return ENOPROTOOPT;
@@ -1045,7 +1050,7 @@ tmp_dh_callback(SSL *ssl OVS_UNUSED, int is_export OVS_UNUSED, int keylength)
 
 /* Returns true if SSL is at least partially configured. */
 bool
-stream_ssl_is_configured(void) 
+stream_ssl_is_configured(void)
 {
     return private_key.file_name || certificate.file_name || ca_cert.file_name;
 }