[ovs-git] Open vSwitch: ofp-parse: Handle buffer resize when parsing actions (master)

dev at openvswitch.org dev at openvswitch.org
Mon Apr 7 15:25:18 UTC 2014

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Open vSwitch".

The branch, master has been updated
       via  65bfce4ae0603c8c3576acc5b3cd1ba5afff4c00 (commit)
      from  42f3bacaf146f3c4fc5990f038c545ec3b70daa5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 65bfce4ae0603c8c3576acc5b3cd1ba5afff4c00
Diffs: http://openvswitch.org/cgi-bin/gitweb.cgi?p=openvswitch;a=commitdiff;h=65bfce4ae0603c8c3576acc5b3cd1ba5afff4c00
Author: Simon Horman <horms at verge.net.au>
ofp-parse: Handle buffer resize when parsing actions
A call to ofpbuf_put() may cause the data of the passed to be resized and
its base address to change.  Thus the address returned by ofpbuf_put()
should be used as the base address rather than relying on the base address
prior to ofpbuf_put().

This avoids the following assertion in ofpact_update_len() from failing
when ofpbuf_put() causes a resize in parse_note(), parse_noargs_dec_ttl(),

    ovs_assert(ofpact == ofpacts->frame);

This restores pointer updates removed by and resolves a regression
introduced by cf3b7538666cd1ef ("ofpbuf: Abstract 'l2' pointer and document
usage conventions.").

Test cases have also been added to exercise this buffer resize in
parse_note(), parse_noargs_dec_ttl(), parse_dec_ttl().

Signed-off-by: Simon Horman <horms at verge.net.au>
Signed-off-by: Jarno Rajahalme <jrajahalme at nicira.com>


Summary of changes:
 lib/ofp-parse.c       |    3 +++
 tests/ofproto-dpif.at |   50 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+)

Open vSwitch

More information about the git mailing list