[ovs-dev] [PATCH 04/12] cfm: Use ofpbuf_new() instead of its out-of-line expansion.

Ben Pfaff blp at nicira.com
Tue Dec 7 11:00:26 PST 2010


---
 lib/cfm.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/lib/cfm.c b/lib/cfm.c
index 428b1a7..567dc57 100644
--- a/lib/cfm.c
+++ b/lib/cfm.c
@@ -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);
 
-- 
1.7.1





More information about the dev mailing list