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(),
parse_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@verge.net.au>
Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>