bridge: Expire bond slave assignments when their loads decay to 0.
[openvswitch] / lib / cfm.c
index 12cf3e96a79c21ab850534d02391555775d3bba4..0d720946fbdafd865a1b3ba1d6ea4f645235c71d 100644 (file)
--- a/lib/cfm.c
+++ b/lib/cfm.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010 Nicira Networks.
+ * Copyright (c) 2010, 2011 Nicira Networks.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -33,7 +33,7 @@
 VLOG_DEFINE_THIS_MODULE(cfm);
 
 #define CCM_OPCODE 1              /* CFM message opcode meaning CCM. */
-#define DEST_ADDR  0x0180C2000030 /* Destination for MD level 0 CCMs. */
+#define DEST_ADDR  UINT64_C(0x0180C2000030) /* MD level 0 CCM destination. */
 
 struct cfm_internal {
     struct cfm cfm;
@@ -118,9 +118,7 @@ compose_ccm(struct cfm_internal *cfmi)
     struct ofpbuf *packet;
     struct eth_header *eth;
 
-    packet = xzalloc(sizeof *packet);
-
-    ofpbuf_init(packet, ETH_HEADER_LEN + CCM_LEN + 2);
+    packet = ofpbuf_new(ETH_HEADER_LEN + CCM_LEN + 2);
 
     ofpbuf_reserve(packet, 2);
 
@@ -437,6 +435,7 @@ cfm_process_heartbeat(struct cfm *cfm, const struct ofpbuf *p)
         rmp       = xzalloc(sizeof *rmp);
         rmp->mpid = ccm_mpid;
         hmap_insert(&cfm->x_remote_mps, &rmp->node, hash_mpid(ccm_mpid));
+        cfm->fault = true;
     }
 
     rmp->recv_time = time_msec();