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. */
}
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);
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
uint16_t ccm_vlan; /* CCM Vlan tag. Zero if none.
CFM_RANDOM_VLAN if random. */
uint8_t ccm_pcp; /* CCM Priority. Zero if none. */
+
+ bool check_tnl_key; /* Verify inbound packet key? */
};
void cfm_init(void);
const char *opstate_str;
const char *cfm_ccm_vlan;
struct cfm_settings s;
+ struct smap netdev_args;
if (!cfg->n_cfm_mpid) {
ofproto_port_clear_cfm(iface->port->bridge->ofproto, iface->ofp_port);
return;
}
+ s.check_tnl_key = false;
+ smap_init(&netdev_args);
+ if (!netdev_get_config(iface->netdev, &netdev_args)) {
+ const char *key = smap_get(&netdev_args, "key");
+ const char *in_key = smap_get(&netdev_args, "in_key");
+
+ s.check_tnl_key = (key && !strcmp(key, "flow"))
+ || (in_key && !strcmp(in_key, "flow"));
+ }
+ smap_destroy(&netdev_args);
+
s.mpid = *cfg->cfm_mpid;
s.interval = smap_get_int(&iface->cfg->other_config, "cfm_interval", 0);
cfm_ccm_vlan = smap_get(&iface->cfg->other_config, "cfm_ccm_vlan");
faulted otherwise.
</p>
+ <p>
+ When operating over tunnels which have no <code>in_key</code>, or an
+ <code>in_key</code> of <code>flow</code>. CFM will only accept CCMs
+ with a tunnel key of zero.
+ </p>
+
<column name="cfm_mpid">
A Maintenance Point ID (MPID) uniquely identifies each endpoint within
a Maintenance Association. The MPID is used to identify this endpoint
<column name="other_config" key="cfm_ccm_pcp"
type='{"type": "integer", "minInteger": 1, "maxInteger": 7}'>
When set, the CFM module will apply a VLAN tag to all CCMs it generates
- with the given PCP value. The VLAN ID of the tag is governed by the
+ with the given PCP value, the VLAN ID of the tag is governed by the
value of <ref column="other_config" key="cfm_ccm_vlan"/>. If
<ref column="other_config" key="cfm_ccm_vlan"/> is unset, a VLAN ID of
zero is used.