From 3779fc82d4822d0d688a65f47c0abb9657a1cf21 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Wed, 6 Feb 2013 22:53:53 +0900 Subject: [PATCH] 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 --- lib/odp-util.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); } } -- 2.39.5