datapath: Use masked flow when validating actions.
authorJesse Gross <jesse@nicira.com>
Tue, 16 Jul 2013 04:30:59 +0000 (21:30 -0700)
committerJesse Gross <jesse@nicira.com>
Tue, 16 Jul 2013 22:37:24 +0000 (15:37 -0700)
commit529db6351a720e3525059370a7ebd2420582395f
tree147fc7699626b0a4f4ceb6f81cd2dc44ea5358b4
parenteb19e5f0781cdf3caec1a0ba172fcaf32da5e481
datapath: Use masked flow when validating actions.

It is important to validate flow actions to ensure that they do
not try to write off the end of a packet. The mechanism to do this
is to ensure that a flow is precise enough to describe valid vs.
invalid packets and only allowing actions on valid flows.

The introduction of megaflows broke this by using a narrow base
flow but a potentially wide match. This meant that while the
original flow was properly validated, later packets might not
conform to that flow and could be truncated. This switches to
using the masked flow instead, effectively requiring that all
possible matching packets be valid in order for a flow's actions
to be accepted.

This change only affects the flow setup path - executed packets
have always used the flow extracted from the packet and therefore
were properly validated.

Signed-off-by: Jesse Gross <jesse@nicira.com>
datapath/datapath.c
datapath/flow.c
datapath/flow.h