ofproto: Implement Nicira Extended Match flexible flow match (NXM).
[openvswitch] / ofproto / pktbuf.c
index 67adb560624cd901351bc6b29d4abb85098f2870..14781c11d3c979e23508e039bfe9da365fcdbc26 100644 (file)
@@ -26,7 +26,7 @@
 #include "vconn.h"
 #include "vlog.h"
 
-VLOG_DEFINE_THIS_MODULE(pktbuf)
+VLOG_DEFINE_THIS_MODULE(pktbuf);
 
 /* Buffers are identified by a 32-bit opaque ID.  We divide the ID
  * into a buffer number (low bits) and a cookie (high bits).  The buffer number
@@ -112,8 +112,8 @@ pktbuf_save(struct pktbuf *pb, struct ofpbuf *buffer, uint16_t in_port)
     if (++p->cookie >= COOKIE_MAX) {
         p->cookie = 0;
     }
-    p->buffer = ofpbuf_new(sizeof(struct ofp_packet_in) + buffer->size);
-    ofpbuf_reserve(p->buffer, sizeof(struct ofp_packet_in));
+    p->buffer = ofpbuf_new_with_headroom(buffer->size,
+                                         sizeof(struct ofp_packet_in));
     ofpbuf_put(p->buffer, buffer->data, buffer->size);
     p->timeout = time_msec() + OVERWRITE_MSECS;
     p->in_port = in_port;