X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ofproto%2Fpktbuf.c;h=aa90295427b91808bfbdbe29a22dfc09aa1784f0;hb=23a98ffed7f9bb5b4e0f196a0f085e1fdd3029b5;hp=67adb560624cd901351bc6b29d4abb85098f2870;hpb=750638bbefd179b91f8fb3c9c1bde855af05cf45;p=openvswitch diff --git a/ofproto/pktbuf.c b/ofproto/pktbuf.c index 67adb560..aa902954 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;