aboutsummaryrefslogtreecommitdiff
path: root/lib/cfm.c
diff options
context:
space:
mode:
authorJustin Pettit <jpettit@nicira.com>2013-06-17 18:07:33 -0700
committerJustin Pettit <jpettit@nicira.com>2013-06-17 21:57:29 -0700
commit642dc74ddb13bf0a0948c3ca0013bd62f8074a9f (patch)
tree2ae9323b12fc7795a695bf738b22607febd888aa /lib/cfm.c
parentdb7d4e469903adf1cbf05c9cd70b9eb77946c202 (diff)
ofproto-dpif: Don't wildcard fields used in special processing.
A number of fields are looked at when determining whether special processing (slow-path) is needed. This commit removes wildcarding when they were consulted. Reported-by: Ethan Jackson <ethan@nicira.com> Reported-by: Paul Ingram <paul@nicira.com> Signed-off-by: Justin Pettit <jpettit@nicira.com>
Diffstat (limited to 'lib/cfm.c')
-rw-r--r--lib/cfm.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/cfm.c b/lib/cfm.c
index 64ad18cf..67c2002f 100644
--- a/lib/cfm.c
+++ b/lib/cfm.c
@@ -577,10 +577,17 @@ 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);
+ memset(&wc->masks.dl_type, 0xff, sizeof wc->masks.dl_type);
+ 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)));