ofproto: Avoid buffer copy in OFPT_PACKET_IN path.
[sliver-openvswitch.git] / lib / dpif-linux.c
index 87c9f32..15283b2 100644 (file)
@@ -460,7 +460,8 @@ dpif_linux_recv(struct dpif *dpif_, struct ofpbuf **bufp)
     int retval;
     int error;
 
-    buf = ofpbuf_new(65536);
+    buf = ofpbuf_new(65536 + DPIF_RECV_MSG_PADDING);
+    ofpbuf_reserve(buf, DPIF_RECV_MSG_PADDING);
     retval = read(dpif->fd, ofpbuf_tail(buf), ofpbuf_tailroom(buf));
     if (retval < 0) {
         error = errno;