diff options
author | Justin Pettit <jpettit@nicira.com> | 2013-06-17 18:07:33 -0700 |
---|---|---|
committer | Justin Pettit <jpettit@nicira.com> | 2013-06-17 21:57:29 -0700 |
commit | 642dc74ddb13bf0a0948c3ca0013bd62f8074a9f (patch) | |
tree | 2ae9323b12fc7795a695bf738b22607febd888aa /lib/cfm.c | |
parent | db7d4e469903adf1cbf05c9cd70b9eb77946c202 (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.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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))); |