Check actions prerequisites in parse_ofp_str()
authorSimon Horman <horms@verge.net.au>
Wed, 8 May 2013 01:50:14 +0000 (10:50 +0900)
committerBen Pfaff <blp@nicira.com>
Wed, 8 May 2013 17:40:52 +0000 (10:40 -0700)
commitb019d34da6e6c185bb093984906adcb36c3f6686
treeda11c641e59779463e3103361b56c795ffa516ab
parentd652859bfd3fd81f3db9344ae5760ba756600b97
Check actions prerequisites in parse_ofp_str()

Add a call to ofpacts_check() in parse_ofp_str() to check pre-requisites.
This is in preparation for removing special-case pre-requisite checking
of learn actions which is useful for the test-suite.

This patch also fixes two tests which this change revealed to be incorrect.

1. Open Flow 1.0 action which sets NXM_NX_IPV6_SRC
   without any pre-requisites

   This is not valid because there should be an IPv6 pre-requisite.

   This portion of the test has been removed as IPv6 pre-requisites are
   only valid when using OXM or NXM, however the test appears
   to be a (non-NXM) Open Flow 1.0 test.

   It has been replaced with a similar test of an action
   that sets the IPv4 source address.

2. Open Flow 1.2 action which sets NXM_NX_IPV6_SRC
   without any pre-requisites.

   This is not valid because there should be an IPv6 pre-requisite.

   This test has been corrected by adding IPv6 as a pre-requisite,
   which is valid for Open Flow 1.2 as it uses OXM.

Use of ofpacts_check() in parse_ofp_str() suggested by Ben Pfaff.

Cc: Ben Pfaff <blp@nicira.com>
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/ofp-parse.c
tests/ovs-ofctl.at