From: Simon Horman Date: Wed, 6 Feb 2013 13:53:53 +0000 (+0900) Subject: odp-util: commit_set_nw_action: use flow's innermost dl_type X-Git-Tag: sliver-openvswitch-1.10.90-1~11^2~72 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=3779fc82d4822d0d688a65f47c0abb9657a1cf21;p=sliver-openvswitch.git odp-util: commit_set_nw_action: use flow's innermost dl_type Use the innermost dl_type when decoding L3 and L4 data from a packet. Signed-off-by: Simon Horman Signed-off-by: Ben Pfaff --- diff --git a/lib/odp-util.c b/lib/odp-util.c index 355a3afe0..f3f66b7cc 100644 --- a/lib/odp-util.c +++ b/lib/odp-util.c @@ -2325,14 +2325,16 @@ static void commit_set_nw_action(const struct flow *flow, struct flow *base, struct ofpbuf *odp_actions) { + ovs_be16 dl_type = flow_innermost_dl_type(flow); + /* Check if flow really have an IP header. */ if (!flow->nw_proto) { return; } - if (base->dl_type == htons(ETH_TYPE_IP)) { + if (dl_type == htons(ETH_TYPE_IP)) { commit_set_ipv4_action(flow, base, odp_actions); - } else if (base->dl_type == htons(ETH_TYPE_IPV6)) { + } else if (dl_type == htons(ETH_TYPE_IPV6)) { commit_set_ipv6_action(flow, base, odp_actions); } }