]> Pileus Git - ~andy/linux/blobdiff - net/ipv6/ip6_gre.c
tunnels: harmonize cleanup done on skb on rx path
[~andy/linux] / net / ipv6 / ip6_gre.c
index f2d0a42f80576b7bbeaebe7009fe6a476fb07236..db992a373011241afcbc3094a683474b67742290 100644 (file)
@@ -509,8 +509,6 @@ static int ip6gre_rcv(struct sk_buff *skb)
                        goto drop;
                }
 
-               secpath_reset(skb);
-
                skb->protocol = gre_proto;
                /* WCCP version 1 and 2 protocol decoding.
                 * - Change protocol to IP
@@ -525,7 +523,6 @@ static int ip6gre_rcv(struct sk_buff *skb)
                skb->mac_header = skb->network_header;
                __pskb_pull(skb, offset);
                skb_postpull_rcsum(skb, skb_transport_header(skb), offset);
-               skb->pkt_type = PACKET_HOST;
 
                if (((flags&GRE_CSUM) && csum) ||
                    (!(flags&GRE_CSUM) && tunnel->parms.i_flags&GRE_CSUM)) {
@@ -557,7 +554,7 @@ static int ip6gre_rcv(struct sk_buff *skb)
                        skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN);
                }
 
-               __skb_tunnel_rx(skb, tunnel->dev);
+               __skb_tunnel_rx(skb, tunnel->dev, tunnel->net);
 
                skb_reset_network_header(skb);
 
@@ -694,6 +691,8 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb,
                        tunnel->err_count = 0;
        }
 
+       skb_scrub_packet(skb, !net_eq(tunnel->net, dev_net(dev)));
+
        max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen + dst->header_len;
 
        if (skb_headroom(skb) < max_headroom || skb_shared(skb) ||
@@ -710,8 +709,6 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb,
                skb = new_skb;
        }
 
-       skb_dst_drop(skb);
-
        if (fl6->flowi6_mark) {
                skb_dst_set(skb, dst);
                ndst = NULL;