X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fcfm.c;h=0d720946fbdafd865a1b3ba1d6ea4f645235c71d;hb=332e0d030b522828b6b93152f860c2bc08bfbbf8;hp=12cf3e96a79c21ab850534d02391555775d3bba4;hpb=b31bcf60cf4fbabca0182196c97b3004e42f53e5;p=openvswitch diff --git a/lib/cfm.c b/lib/cfm.c index 12cf3e96..0d720946 100644 --- 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();