ipsec: unset IPSEC_MARK flag from skb_mark after tunnel packet is decapsulated
authorAnsis Atteka <aatteka@nicira.com>
Thu, 14 Mar 2013 18:53:00 +0000 (11:53 -0700)
committerAnsis Atteka <aatteka@nicira.com>
Mon, 18 Mar 2013 16:22:46 +0000 (09:22 -0700)
After tunnel packet is unencapsulated we should unset IPsec flag from
skb_mark.

Otherwise, IPsec policies would be applied one more time on internal
interfaces, if there is one. This is especially necessary after we
will introduce global, low-priority IPsec drop policy that will make
sure that we never let through marked but unencrypted packets.

Signed-off-by: Ansis Atteka <aatteka@nicira.com>
Issue: 15074

ofproto/ofproto-dpif.c
ofproto/tunnel.c
ofproto/tunnel.h

index ef5fb63..d56b51a 100644 (file)
@@ -5811,6 +5811,7 @@ compose_output_action__(struct action_xlate_ctx *ctx, uint16_t ofp_port,
         if (out_port != odp_port) {
             ctx->flow.vlan_tci = htons(0);
         }
+        ctx->flow.skb_mark &= ~IPSEC_MARK;
     }
     commit_odp_actions(&ctx->flow, &ctx->base_flow, ctx->odp_actions);
     nl_msg_put_u32(ctx->odp_actions, OVS_ACTION_ATTR_OUTPUT, out_port);
index 13d821c..8aa7fbe 100644 (file)
@@ -37,9 +37,6 @@
 
 VLOG_DEFINE_THIS_MODULE(tunnel);
 
-/* skb mark used for IPsec tunnel packets */
-#define IPSEC_MARK 1
-
 struct tnl_match {
     ovs_be64 in_key;
     ovs_be32 ip_src;
index acb69a8..1b055ae 100644 (file)
@@ -20,6 +20,9 @@
 #include <stdint.h>
 #include "flow.h"
 
+/* skb mark used for IPsec tunnel packets */
+#define IPSEC_MARK 1
+
 /* Tunnel port emulation layer.
  *
  * These functions emulate tunnel virtual ports based on the outer