git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ofpbuf: Add ofpbuf_new_with_headroom(), ofpbuf_clone_with_headroom().
[sliver-openvswitch.git]
/
ofproto
/
pktbuf.c
diff --git
a/ofproto/pktbuf.c
b/ofproto/pktbuf.c
index
67adb56
..
aa90295
100644
(file)
--- 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;
}
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;
ofpbuf_put(p->buffer, buffer->data, buffer->size);
p->timeout = time_msec() + OVERWRITE_MSECS;
p->in_port = in_port;