[ovs-dev] [PATCH 2/2] ofproto-dpif: Don't wildcard fields used in special processing.

Ethan Jackson ethan at nicira.com
Tue Jun 18 01:31:40 UTC 2013


> +/* 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);
>      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)));

I know we never wildcard the tnl_key, but I'd prefer not to rely on
that in the cfm module.  Could we add something like?:

if (cfm_check_tnl_key) {
    memset(<the tunnel key>);
}

Rest looks good to me, thank you.

Acked-by: Ethan Jackson <ethan at nicira.com>



More information about the dev mailing list