ovs-brcompatd: Don't consume CPU if can't connect to config db
[openvswitch] / vswitchd / bridge.c
index 4cf1b86f8f4931d57a34e23788e101b83a72b2a5..0a8a9e09b49ff59cb6b9dac15784f9207a5ba6d0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2008, 2009 Nicira Networks
+/* Copyright (c) 2008, 2009, 2010 Nicira Networks
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
 #include "sha1.h"
 #include "shash.h"
 #include "socket-util.h"
+#include "stream-ssl.h"
 #include "svec.h"
 #include "timeval.h"
 #include "util.h"
 #include "unixctl.h"
 #include "vconn.h"
-#include "vconn-ssl.h"
 #include "vswitchd/vswitch-idl.h"
 #include "xenserver.h"
 #include "xtoxll.h"
@@ -366,11 +366,11 @@ bridge_configure_ssl(const struct ovsrec_ssl *ssl)
     }
 
     if (config_string_change(ssl->private_key, &private_key_file)) {
-        vconn_ssl_set_private_key_file(private_key_file);
+        stream_ssl_set_private_key_file(private_key_file);
     }
 
     if (config_string_change(ssl->certificate, &certificate_file)) {
-        vconn_ssl_set_certificate_file(certificate_file);
+        stream_ssl_set_certificate_file(certificate_file);
     }
 
     /* We assume that even if the filename hasn't changed, if the CA cert 
@@ -380,7 +380,7 @@ bridge_configure_ssl(const struct ovsrec_ssl *ssl)
      * restarted.  We may want to address this in vconn's SSL library. */
     if (config_string_change(ssl->ca_cert, &cacert_file)
         || (cacert_file && stat(cacert_file, &s) && errno == ENOENT)) {
-        vconn_ssl_set_ca_cert_file(cacert_file, ssl->bootstrap_ca_cert);
+        stream_ssl_set_ca_cert_file(cacert_file, ssl->bootstrap_ca_cert);
     }
 }
 #endif
@@ -3427,7 +3427,7 @@ iface_is_internal(const struct bridge *br, const char *if_name)
     }
 
     port = port_lookup(br, if_name);
-    if (port->n_ifaces > 1 && port->cfg->bond_fake_iface) {
+    if (port && port->n_ifaces > 1 && port->cfg->bond_fake_iface) {
         return true;
     }
     return false;