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:38:57 +0000 (15:38 -0700)
commit853acc1d2b5f0596d8a6a31a3310b61eb43c0ea7
tree44425394cd78891e06cf4b588296fdbecb8dbc9b
parentd3a642e736ce251b49f9f2b5fed23da79ba4e3aa
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