]> git.proxmox.com Git - mirror_ovs.git/commit - lib/learn.c
learn: Fix iteration over learning specs.
authorBen Pfaff <blp@ovn.org>
Fri, 2 Sep 2016 20:26:50 +0000 (13:26 -0700)
committerBen Pfaff <blp@ovn.org>
Fri, 2 Sep 2016 22:55:00 +0000 (15:55 -0700)
commitc65a31e2622402bcb1b0b8df0ab928b83a0ed4a0
treee6a082cad0601119035e5d71f18dde9bc879e9a8
parent784bf5d4eb3ce41c93927991d57ef6522363cd76
learn: Fix iteration over learning specs.

struct ofpact_learn_spec is variable-length.  The 'n_specs' member of
struct ofpact_learn counted the number of specs, but the iteration loops
over struct ofpact_learn_spec only iterated as far as the *minimum* length
of 'n_specs' specs.

This fixes the problem, which exhibited as consistent failures for test 431
(learning action - TCPv6 port learning), seemingly only on i386 since it
shows up for my personal development machine but appears to not happen for
anyone else.

Fixes: dfe191d5faa6 ("ofp-actions: Waste less memory in learn actions.")
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
include/openvswitch/ofp-actions.h
lib/learn.c
lib/ofp-actions.c