ofproto-dpif: Always un-wildcard 'dl_type'.
[sliver-openvswitch.git] / lib / cfm.c
index 4d4ebcb..1c98ed8 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. */
@@ -577,10 +577,16 @@ cfm_set_netdev(struct cfm *cfm, const struct netdev *netdev)
     }
 }
 
-/* Returns true if 'cfm' should process packets from 'flow'. */
+/* Returns true if 'cfm' should process packets from 'flow'.  Sets
+ * fields in 'wc' that were used to make the determination. */
 bool
-cfm_should_process_flow(const struct cfm *cfm, const struct flow *flow)
+cfm_should_process_flow(const struct cfm *cfm, const struct flow *flow,
+                        struct flow_wildcards *wc)
 {
+    memset(&wc->masks.dl_dst, 0xff, sizeof wc->masks.dl_dst);
+    if (cfm->check_tnl_key) {
+        memset(&wc->masks.tunnel.tun_id, 0xff, sizeof wc->masks.tunnel.tun_id);
+    }
     return (ntohs(flow->dl_type) == ETH_TYPE_CFM
             && eth_addr_equals(flow->dl_dst, cfm_ccm_addr(cfm))
             && (!cfm->check_tnl_key || flow->tunnel.tun_id == htonll(0)));