X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ofproto%2Fpktbuf.c;fp=ofproto%2Fpktbuf.c;h=f28111b90c736ab4fc9aa204afb1fe9609499daa;hb=d15a5ee594f46a855788652e687aa5d736d530fb;hp=7e5981d5cbd344ab4c31a82ce85148cc2dbbbc1e;hpb=e9ec7451755a50449811738b5a0adad49a864fe3;p=sliver-openvswitch.git diff --git a/ofproto/pktbuf.c b/ofproto/pktbuf.c index 7e5981d5c..f28111b90 100644 --- a/ofproto/pktbuf.c +++ b/ofproto/pktbuf.c @@ -113,8 +113,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;