diff options
author | Nicolas Dichtel <nicolas.dichtel@6wind.com> | 2013-09-02 09:34:57 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-09-04 00:27:25 -0400 |
commit | 963a88b31ddbbe99f38502239b1a46601773d217 (patch) | |
tree | 9c07bbee7240db69d82d2152b7e47013012c739b /net/ipv6 | |
parent | 8b27f27797cac5ed9b2f3e63dac89a7ae70e70a7 (diff) |
tunnels: harmonize cleanup done on skb on xmit path
The goal of this patch is to harmonize cleanup done on a skbuff on xmit path.
Before this patch, behaviors were different depending of the tunnel type.
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/ip6_gre.c | 4 | ||||
-rw-r--r-- | net/ipv6/ip6_tunnel.c | 4 | ||||
-rw-r--r-- | net/ipv6/sit.c | 5 |
3 files changed, 4 insertions, 9 deletions
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index f2d0a42f8057..f179ff1f56ec 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c | |||
@@ -694,6 +694,8 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb, | |||
694 | tunnel->err_count = 0; | 694 | tunnel->err_count = 0; |
695 | } | 695 | } |
696 | 696 | ||
697 | skb_scrub_packet(skb, !net_eq(tunnel->net, dev_net(dev))); | ||
698 | |||
697 | max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen + dst->header_len; | 699 | max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen + dst->header_len; |
698 | 700 | ||
699 | if (skb_headroom(skb) < max_headroom || skb_shared(skb) || | 701 | if (skb_headroom(skb) < max_headroom || skb_shared(skb) || |
@@ -710,8 +712,6 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb, | |||
710 | skb = new_skb; | 712 | skb = new_skb; |
711 | } | 713 | } |
712 | 714 | ||
713 | skb_dst_drop(skb); | ||
714 | |||
715 | if (fl6->flowi6_mark) { | 715 | if (fl6->flowi6_mark) { |
716 | skb_dst_set(skb, dst); | 716 | skb_dst_set(skb, dst); |
717 | ndst = NULL; | 717 | ndst = NULL; |
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 72372ac90159..ecbcdbd4bc4f 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -1001,8 +1001,7 @@ static int ip6_tnl_xmit2(struct sk_buff *skb, | |||
1001 | goto tx_err_dst_release; | 1001 | goto tx_err_dst_release; |
1002 | } | 1002 | } |
1003 | 1003 | ||
1004 | if (!net_eq(t->net, dev_net(dev))) | 1004 | skb_scrub_packet(skb, !net_eq(t->net, dev_net(dev))); |
1005 | skb_scrub_packet(skb, true); | ||
1006 | 1005 | ||
1007 | /* | 1006 | /* |
1008 | * Okay, now see if we can stuff it in the buffer as-is. | 1007 | * Okay, now see if we can stuff it in the buffer as-is. |
@@ -1021,7 +1020,6 @@ static int ip6_tnl_xmit2(struct sk_buff *skb, | |||
1021 | consume_skb(skb); | 1020 | consume_skb(skb); |
1022 | skb = new_skb; | 1021 | skb = new_skb; |
1023 | } | 1022 | } |
1024 | skb_dst_drop(skb); | ||
1025 | if (fl6->flowi6_mark) { | 1023 | if (fl6->flowi6_mark) { |
1026 | skb_dst_set(skb, dst); | 1024 | skb_dst_set(skb, dst); |
1027 | ndst = NULL; | 1025 | ndst = NULL; |
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index b2e44f478e14..82b425b9b7d2 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -860,9 +860,6 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, | |||
860 | tunnel->err_count = 0; | 860 | tunnel->err_count = 0; |
861 | } | 861 | } |
862 | 862 | ||
863 | if (!net_eq(tunnel->net, dev_net(dev))) | ||
864 | skb_scrub_packet(skb, true); | ||
865 | |||
866 | /* | 863 | /* |
867 | * Okay, now see if we can stuff it in the buffer as-is. | 864 | * Okay, now see if we can stuff it in the buffer as-is. |
868 | */ | 865 | */ |
@@ -889,7 +886,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb, | |||
889 | tos = INET_ECN_encapsulate(tos, ipv6_get_dsfield(iph6)); | 886 | tos = INET_ECN_encapsulate(tos, ipv6_get_dsfield(iph6)); |
890 | 887 | ||
891 | err = iptunnel_xmit(rt, skb, fl4.saddr, fl4.daddr, IPPROTO_IPV6, tos, | 888 | err = iptunnel_xmit(rt, skb, fl4.saddr, fl4.daddr, IPPROTO_IPV6, tos, |
892 | ttl, df); | 889 | ttl, df, !net_eq(tunnel->net, dev_net(dev))); |
893 | iptunnel_xmit_stats(err, &dev->stats, dev->tstats); | 890 | iptunnel_xmit_stats(err, &dev->stats, dev->tstats); |
894 | return NETDEV_TX_OK; | 891 | return NETDEV_TX_OK; |
895 | 892 | ||