X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=lib%2Fcfm.c;h=b71c242a54763eb4a182b7df98af1e591f2d328f;hb=c2f0373a8248d0c20d2f876d7f3bc61a400d9924;hp=fc999ab20f7554a6454f9dc15a7304052c1a63cc;hpb=4653c5583a3ec9d7184782fee3d2f93602795686;p=openvswitch diff --git a/lib/cfm.c b/lib/cfm.c index fc999ab2..b71c242a 100644 --- a/lib/cfm.c +++ b/lib/cfm.c @@ -86,6 +86,7 @@ struct cfm { struct hmap_node hmap_node; /* Node in all_cfms list. */ uint64_t mpid; + bool check_tnl_key; /* Verify the tunnel key of inbound packets? */ bool extended; /* Extended mode. */ bool booted; /* A full fault interval has occured. */ enum cfm_fault_reason fault; /* Connectivity fault status. */ @@ -505,6 +506,7 @@ cfm_configure(struct cfm *cfm, const struct cfm_settings *s) } cfm->mpid = s->mpid; + cfm->check_tnl_key = s->check_tnl_key; cfm->extended = s->extended; cfm->opup = s->opup; interval = ms_to_ccm_interval(s->interval); @@ -533,7 +535,8 @@ bool cfm_should_process_flow(const struct cfm *cfm, const struct flow *flow) { return (ntohs(flow->dl_type) == ETH_TYPE_CFM - && eth_addr_equals(flow->dl_dst, cfm_ccm_addr(cfm))); + && eth_addr_equals(flow->dl_dst, cfm_ccm_addr(cfm)) + && (!cfm->check_tnl_key || flow->tunnel.tun_id == htonll(0))); } /* Updates internal statistics relevant to packet 'p'. Should be called on