Here's an incremental.
---
lib/cfm.c | 7 +++++--
lib/cfm.h | 4 +++-
vswitchd/bridge.c | 4 ++--
vswitchd/vswitch.xml | 4 ++--
4 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/lib/cfm.c b/lib/cfm.c
index 10a9428..8b9e5bc 100644
--- a/lib/cfm.c
+++ b/lib/cfm.c
@@ -97,7 +97,8 @@ struct cfm {
uint32_t seq; /* The sequence number of our last CCM. */
uint8_t ccm_interval; /* The CCM transmission interval. */
int ccm_interval_ms; /* 'ccm_interval' in milliseconds. */
- uint16_t ccm_vlan; /* Vlan tag of CCM PDUs. UINT16_MAX if random. */
+ uint16_t ccm_vlan; /* Vlan tag of CCM PDUs. CFM_RANDOM_VLAN if
+ random. */
uint8_t ccm_pcp; /* Priority of CCM PDUs. */
uint8_t maid[CCM_MAID_LEN]; /* The MAID of this CFM. */
@@ -398,7 +399,9 @@ cfm_compose_ccm(struct cfm *cfm, struct ofpbuf *packet,
timer_set_duration(&cfm->tx_timer, cfm->ccm_interval_ms);
eth_compose(packet, cfm_ccm_addr(cfm), eth_src, ETH_TYPE_CFM, sizeof *ccm);
- ccm_vlan = cfm->ccm_vlan != UINT16_MAX ? cfm->ccm_vlan : random_uint16();
+ ccm_vlan = (cfm->ccm_vlan != CFM_RANDOM_VLAN
+ ? cfm->ccm_vlan
+ : random_uint16());
ccm_vlan = ccm_vlan & VLAN_VID_MASK;
if (ccm_vlan || cfm->ccm_pcp) {
diff --git a/lib/cfm.h b/lib/cfm.h
index c706c70..2556a32 100644
--- a/lib/cfm.h
+++ b/lib/cfm.h
@@ -24,6 +24,8 @@
struct flow;
struct ofpbuf;
+#define CFM_RANDOM_VLAN UINT16_MAX
+
#define CFM_FAULT_REASONS \
CFM_FAULT_REASON(RECV, recv) \
CFM_FAULT_REASON(RDI, rdi) \
@@ -52,7 +54,7 @@ struct cfm_settings {
bool extended; /* Run in extended mode. */
bool opup; /* Operational State. */
uint16_t ccm_vlan; /* CCM Vlan tag. Zero if none.
- UINT16_MAX if random. */
+ CFM_RANDOM_VLAN if random. */
uint8_t ccm_pcp; /* CCM Priority. Zero if none. */
};
diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index 56589de..6449333 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -3245,10 +3245,10 @@ iface_configure_cfm(struct iface *iface)
}
if (!strcasecmp("random", cfm_ccm_vlan)) {
- s.ccm_vlan = UINT16_MAX;
+ s.ccm_vlan = CFM_RANDOM_VLAN;
} else {
s.ccm_vlan = atoi(cfm_ccm_vlan);
- if (s.ccm_vlan == UINT16_MAX) {
+ if (s.ccm_vlan == CFM_RANDOM_VLAN) {
s.ccm_vlan = 0;
}
}
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index 378d16a..e3e2a48 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -1766,8 +1766,8 @@
<column name="other_config" key="cfm_ccm_vlan"
type='{"type": "integer", "minInteger": 1, "maxInteger": 4095}'>
When set, the CFM module will apply a VLAN tag to all CCMs it generates
- with the given value. May be the string "random" in which case each
- CCM will be tagged with a different randomly generated VLAN.
+ with the given value. May be the string <code>random</code> in which
+ case each CCM will be tagged with a different randomly generated VLAN.
</column>
<column name="other_config" key="cfm_ccm_pcp"
--
1.7.9.2
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev