Store the original action code with the strip vlan action, so that it can be printed back properly.
Signed-off-by: Jarno Rajahalme <jrajaha...@nicira.com> --- lib/ofp-actions.c | 7 ++++--- lib/ofp-parse.c | 2 +- tests/ofp-actions.at | 2 +- tests/ovs-ofctl.at | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c index c7322f6..edbc92f 100644 --- a/lib/ofp-actions.c +++ b/lib/ofp-actions.c @@ -539,7 +539,7 @@ ofpact_from_openflow10(const union ofp_action *a, struct ofpbuf *out) break; case OFPUTIL_OFPAT10_STRIP_VLAN: - ofpact_put_STRIP_VLAN(out); + ofpact_put_STRIP_VLAN(out)->ofpact.compat = code; break; case OFPUTIL_OFPAT10_SET_DL_SRC: @@ -828,7 +828,7 @@ ofpact_from_openflow11(const union ofp_action *a, struct ofpbuf *out) break; case OFPUTIL_OFPAT11_POP_VLAN: - ofpact_put_STRIP_VLAN(out); + ofpact_put_STRIP_VLAN(out)->ofpact.compat = code; break; case OFPUTIL_OFPAT11_SET_QUEUE: @@ -2769,7 +2769,8 @@ ofpact_format(const struct ofpact *a, struct ds *s) break; case OFPACT_STRIP_VLAN: - ds_put_cstr(s, "strip_vlan"); + ds_put_cstr(s, a->compat == OFPUTIL_OFPAT11_POP_VLAN + ? "pop_vlan" : "strip_vlan"); break; case OFPACT_PUSH_VLAN: diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c index 73a56b8..1ada870 100644 --- a/lib/ofp-parse.c +++ b/lib/ofp-parse.c @@ -653,7 +653,7 @@ parse_named_action(enum ofputil_action_code code, case OFPUTIL_OFPAT10_STRIP_VLAN: case OFPUTIL_OFPAT11_POP_VLAN: - ofpact_put_STRIP_VLAN(ofpacts); + ofpact_put_STRIP_VLAN(ofpacts)->ofpact.compat = code; break; case OFPUTIL_OFPAT11_PUSH_VLAN: diff --git a/tests/ofp-actions.at b/tests/ofp-actions.at index e3fc2bc..244c9ee 100644 --- a/tests/ofp-actions.at +++ b/tests/ofp-actions.at @@ -165,7 +165,7 @@ AT_DATA([test-data], [dnl # actions=mod_tp_dst:443 000a 0008 01bb 0000 -# actions=strip_vlan +# actions=pop_vlan 0012 0008 00000000 # actions=set_queue:2309737729 diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at index 131beaf..6f0456f 100644 --- a/tests/ovs-ofctl.at +++ b/tests/ovs-ofctl.at @@ -163,7 +163,7 @@ AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], chosen protocol: OpenFlow11 OFPT_FLOW_MOD (OF1.1): ADD table:255 tcp,tp_src=123 out_port:5 actions=FLOOD OFPT_FLOW_MOD (OF1.1): ADD table:255 in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop -OFPT_FLOW_MOD (OF1.1): ADD table:255 udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0 +OFPT_FLOW_MOD (OF1.1): ADD table:255 udp,dl_vlan_pcp=7 idle:5 actions=pop_vlan,output:0 OFPT_FLOW_MOD (OF1.1): ADD table:255 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 OFPT_FLOW_MOD (OF1.1): ADD table:255 udp,nw_src=192.168.0.3,tp_dst=53 actions=mod_nw_ecn:2,output:1 OFPT_FLOW_MOD (OF1.1): ADD table:255 priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535 @@ -200,7 +200,7 @@ AT_CHECK([[sed 's/ (xid=0x[0-9a-fA-F]*)//' stdout]], [0], chosen protocol: OXM-OpenFlow12 OFPT_FLOW_MOD (OF1.2): ADD table:255 tcp,tp_src=123 actions=FLOOD OFPT_FLOW_MOD (OF1.2): ADD table:255 in_port=LOCAL,dl_vlan=9,dl_src=00:0a:e4:25:6b:b0 actions=drop -OFPT_FLOW_MOD (OF1.2): ADD table:255 udp,dl_vlan_pcp=7 idle:5 actions=strip_vlan,output:0 +OFPT_FLOW_MOD (OF1.2): ADD table:255 udp,dl_vlan_pcp=7 idle:5 actions=pop_vlan,output:0 OFPT_FLOW_MOD (OF1.2): ADD table:255 tcp,nw_src=192.168.0.3,tp_dst=80 actions=set_queue:37,output:1 OFPT_FLOW_MOD (OF1.2): ADD table:255 udp,nw_src=192.168.0.3,tp_dst=53 actions=pop_queue,output:1 OFPT_FLOW_MOD (OF1.2): ADD table:255 priority=60000 cookie:0x123456789abcdef hard:10 actions=CONTROLLER:65535 -- 1.7.10.4 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev