odp-util: commit_set_nw_action: use flow's innermost dl_type
authorSimon Horman <horms@verge.net.au>
Wed, 6 Feb 2013 13:53:53 +0000 (22:53 +0900)
committerBen Pfaff <blp@nicira.com>
Wed, 6 Feb 2013 17:19:10 +0000 (09:19 -0800)
Use the innermost dl_type when decoding L3 and L4 data from a packet.

Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/odp-util.c

index 355a3af..f3f66b7 100644 (file)
@@ -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);
     }
 }