[ovs-dev] [PATCH 08/16] odp-util: commit_set_nw_action: use flow's innermost dl_type

Simon Horman horms at verge.net.au
Thu Jan 3 02:53:42 UTC 2013


Use the innermost dl_type when decoding L3 and L4 data from a packet.

Signed-off-by: Simon Horman <horms at verge.net.au>

---

v2.13
* No change

v2.12
* Use flow_innermost_dl_type helper

v2.11
* First post
---
 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 77882e1..48c82b0 100644
--- a/lib/odp-util.c
+++ b/lib/odp-util.c
@@ -2263,14 +2263,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);
     }
 }
-- 
1.7.10.4




More information about the dev mailing list