mirror of
https://github.com/openvswitch/ovs
synced 2025-09-02 07:15:17 +00:00
ofpbuf: Add ofpbuf_new_with_headroom(), ofpbuf_clone_with_headroom().
These new functions simplify an increasingly common usage pattern. Suggested-by: Jesse Gross <jesse@nicira.com>
This commit is contained in:
@@ -1262,8 +1262,7 @@ dp_netdev_output_control(struct dp_netdev *dp, const struct ofpbuf *packet,
|
||||
}
|
||||
|
||||
msg_size = sizeof *header + packet->size;
|
||||
msg = ofpbuf_new(msg_size + DPIF_RECV_MSG_PADDING);
|
||||
ofpbuf_reserve(msg, DPIF_RECV_MSG_PADDING);
|
||||
msg = ofpbuf_new_with_headroom(msg_size, DPIF_RECV_MSG_PADDING);
|
||||
header = ofpbuf_put_uninit(msg, sizeof *header);
|
||||
header->type = queue_no;
|
||||
header->length = msg_size;
|
||||
|
Reference in New Issue
Block a user