X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ofproto%2Fpktbuf.c;h=aa90295427b91808bfbdbe29a22dfc09aa1784f0;hb=68efcbec41b0acfd8bb7579a5d38afd71b6daf7c;hp=67adb560624cd901351bc6b29d4abb85098f2870;hpb=f79cb67e689566cfbf3071e0ac0e29923ada5a97;p=sliver-openvswitch.git diff --git a/ofproto/pktbuf.c b/ofproto/pktbuf.c index 67adb5606..aa9029542 100644 --- a/ofproto/pktbuf.c +++ b/ofproto/pktbuf.c @@ -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;