X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fodp-util.c;h=f9e9321bad8f7c05a0d1a73aa4628cf3c93bde0c;hb=1b035ef20084e14b90537fb3873af99f45d40e34;hp=54e5b1287384229d590e757ae2cd782fede4985a;hpb=d30e714ccb9d13caf39d14d5b2fc9523b678ed51;p=sliver-openvswitch.git diff --git a/lib/odp-util.c b/lib/odp-util.c index 54e5b1287..f9e9321ba 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -2323,9 +2323,9 @@ commit_set_nw_action(const struct flow *flow, struct flow *base, return; } - if (flow->dl_type == htons(ETH_TYPE_IP)) { + if (base->dl_type == htons(ETH_TYPE_IP)) { commit_set_ipv4_action(flow, base, odp_actions); - } else if (flow->dl_type == htons(ETH_TYPE_IPV6)) { + } else if (base->dl_type == htons(ETH_TYPE_IPV6)) { commit_set_ipv6_action(flow, base, odp_actions); } } @@ -2334,7 +2334,7 @@ static void commit_set_port_action(const struct flow *flow, struct flow *base, struct ofpbuf *odp_actions) { - if (!base->tp_src && !base->tp_dst) { + if (!is_ip_any(base) || (!base->tp_src && !base->tp_dst)) { return; } @@ -2398,9 +2398,13 @@ commit_odp_actions(const struct flow *flow, struct flow *base, { commit_set_ether_addr_action(flow, base, odp_actions); commit_vlan_action(flow, base, odp_actions); - commit_mpls_action(flow, base, odp_actions); commit_set_nw_action(flow, base, odp_actions); commit_set_port_action(flow, base, odp_actions); + /* Commiting MPLS actions should occur after committing nw and port + * actions. This is because committing MPLS actions may alter a packet so + * that it is no longer IP and thus nw and port actions are no longer valid. + */ + commit_mpls_action(flow, base, odp_actions); commit_set_priority_action(flow, base, odp_actions); commit_set_skb_mark_action(flow, base, odp_actions); }