From: Simon Horman Date: Wed, 19 Feb 2014 12:27:16 +0000 (+0900) Subject: ofp-actions: Correct pop MPLS ethtype as consistency test X-Git-Url: http://git.onelab.eu/?p=sliver-openvswitch.git;a=commitdiff_plain;h=b3f2fc93e3f357f8d05a92f53ec253339a40887f ofp-actions: Correct pop MPLS ethtype as consistency test Correct pop MPLS ethtype consistency check to verify that the packet has an MPLS ethtype before the pop action rather than after: an MPLS ethtype is a pre-condition but not a post-condition of pop MPLS. With this change the consistency check in ofpact_check__() becomes consistent with that in ofpact_from_nxast(). This was found using Ryu tests via the new make check-ryu target. It allows all of the "POP_MPLS"[1] tests to pass where they previously failed. [1] http://osrg.github.io/ryu-certification/switch/ovs Cc: Jarno Rajahalme Signed-off-by: Simon Horman Signed-off-by: Ben Pfaff --- diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c index 781c3a1ca..3cd1e8b40 100644 --- a/lib/ofp-actions.c +++ b/lib/ofp-actions.c @@ -2067,10 +2067,10 @@ ofpact_check__(enum ofputil_protocol *usable_protocols, struct ofpact *a, return 0; case OFPACT_POP_MPLS: - flow->dl_type = ofpact_get_POP_MPLS(a)->ethertype; if (!eth_type_mpls(flow->dl_type)) { inconsistent_match(usable_protocols); } + flow->dl_type = ofpact_get_POP_MPLS(a)->ethertype; return 0; case OFPACT_SAMPLE: