leak-checker: Remove because it cannot be made thread-safe.
[sliver-openvswitch.git] / lib / cfm.c
index d16e2dd..64ad18c 100644 (file)
--- a/lib/cfm.c
+++ b/lib/cfm.c
@@ -92,9 +92,9 @@ struct cfm {
     bool check_tnl_key;    /* Verify the tunnel key of inbound packets? */
     bool extended;         /* Extended mode. */
     bool demand;           /* Demand mode. */
-    bool booted;           /* A full fault interval has occured. */
+    bool booted;           /* A full fault interval has occurred. */
     enum cfm_fault_reason fault;  /* Connectivity fault status. */
-    enum cfm_fault_reason recv_fault;  /* Bit mask of faults occuring on
+    enum cfm_fault_reason recv_fault;  /* Bit mask of faults occurring on
                                           receive. */
     bool opup;             /* Operational State. */
     bool remote_opup;      /* Remote Operational State. */
@@ -567,6 +567,16 @@ cfm_configure(struct cfm *cfm, const struct cfm_settings *s)
     return true;
 }
 
+/* Must be called when the netdev owned by 'cfm' should change. */
+void
+cfm_set_netdev(struct cfm *cfm, const struct netdev *netdev)
+{
+    if (cfm->netdev != netdev) {
+        netdev_close(cfm->netdev);
+        cfm->netdev = netdev_ref(netdev);
+    }
+}
+
 /* Returns true if 'cfm' should process packets from 'flow'. */
 bool
 cfm_should_process_flow(const struct cfm *cfm, const struct flow *flow)