[ovs-dev] [PATCH 16/19] odp-util: commit_set_nw_action: use flow's encap_dl_type

Simon Horman horms at verge.net.au
Mon Dec 24 02:35:22 UTC 2012


If the encap_dl_type is set then it indicates information about the
dl_type of an encapsulated frame and should be used when decoding
L3 and L4 information.

Signed-off-by: Simon Horman <horms at verge.net.au>
---
 lib/odp-util.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/odp-util.c b/lib/odp-util.c
index 01c79e6..4b6e4f0 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -2304,14 +2304,18 @@ static void
 commit_set_nw_action(const struct flow *flow, struct flow *base,
                      struct ofpbuf *odp_actions)
 {
+    ovs_be16 dl_type = flow->encap_dl_type
+        ? flow->encap_dl_type
+        : flow->dl_type;
+
     /* 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);
     }
 }
-- 
1.7.10.4




More information about the dev mailing list