cfm: Update netdev when changed.
[cascardo/ovs.git] / lib / cfm.c
index 69d8188..8f22a35 100644 (file)
--- a/lib/cfm.c
+++ b/lib/cfm.c
@@ -566,6 +566,15 @@ 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) {
+        cfm->netdev = netdev;
+    }
+}
+
 /* Returns true if 'cfm' should process packets from 'flow'. */
 bool
 cfm_should_process_flow(const struct cfm *cfm, const struct flow *flow)