diff options
-rw-r--r-- | drivers/net/vxlan.c | 6 | ||||
-rw-r--r-- | include/net/ip6_tunnel.h | 1 | ||||
-rw-r--r-- | include/net/ip_tunnels.h | 2 | ||||
-rw-r--r-- | net/ipv4/ip_tunnel.c | 6 | ||||
-rw-r--r-- | net/ipv4/ip_tunnel_core.c | 7 | ||||
-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 | ||||
-rw-r--r-- | net/openvswitch/vport-gre.c | 2 |
9 files changed, 15 insertions, 22 deletions
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index a334bfb91c5a..ebda3a1c2f31 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c | |||
@@ -1397,6 +1397,8 @@ static int vxlan6_xmit_skb(struct vxlan_sock *vs, | |||
1397 | skb->encapsulation = 1; | 1397 | skb->encapsulation = 1; |
1398 | } | 1398 | } |
1399 | 1399 | ||
1400 | skb_scrub_packet(skb, false); | ||
1401 | |||
1400 | min_headroom = LL_RESERVED_SPACE(dst->dev) + dst->header_len | 1402 | min_headroom = LL_RESERVED_SPACE(dst->dev) + dst->header_len |
1401 | + VXLAN_HLEN + sizeof(struct ipv6hdr) | 1403 | + VXLAN_HLEN + sizeof(struct ipv6hdr) |
1402 | + (vlan_tx_tag_present(skb) ? VLAN_HLEN : 0); | 1404 | + (vlan_tx_tag_present(skb) ? VLAN_HLEN : 0); |
@@ -1432,7 +1434,6 @@ static int vxlan6_xmit_skb(struct vxlan_sock *vs, | |||
1432 | memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); | 1434 | memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); |
1433 | IPCB(skb)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE | IPSKB_XFRM_TRANSFORMED | | 1435 | IPCB(skb)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE | IPSKB_XFRM_TRANSFORMED | |
1434 | IPSKB_REROUTED); | 1436 | IPSKB_REROUTED); |
1435 | skb_dst_drop(skb); | ||
1436 | skb_dst_set(skb, dst); | 1437 | skb_dst_set(skb, dst); |
1437 | 1438 | ||
1438 | if (!skb_is_gso(skb) && !(dst->dev->features & NETIF_F_IPV6_CSUM)) { | 1439 | if (!skb_is_gso(skb) && !(dst->dev->features & NETIF_F_IPV6_CSUM)) { |
@@ -1528,7 +1529,8 @@ int vxlan_xmit_skb(struct vxlan_sock *vs, | |||
1528 | if (err) | 1529 | if (err) |
1529 | return err; | 1530 | return err; |
1530 | 1531 | ||
1531 | return iptunnel_xmit(rt, skb, src, dst, IPPROTO_UDP, tos, ttl, df); | 1532 | return iptunnel_xmit(rt, skb, src, dst, IPPROTO_UDP, tos, ttl, df, |
1533 | false); | ||
1532 | } | 1534 | } |
1533 | EXPORT_SYMBOL_GPL(vxlan_xmit_skb); | 1535 | EXPORT_SYMBOL_GPL(vxlan_xmit_skb); |
1534 | 1536 | ||
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h index 2265b0bf97e5..6d1549c4893c 100644 --- a/include/net/ip6_tunnel.h +++ b/include/net/ip6_tunnel.h | |||
@@ -75,7 +75,6 @@ static inline void ip6tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | |||
75 | struct net_device_stats *stats = &dev->stats; | 75 | struct net_device_stats *stats = &dev->stats; |
76 | int pkt_len, err; | 76 | int pkt_len, err; |
77 | 77 | ||
78 | nf_reset(skb); | ||
79 | pkt_len = skb->len; | 78 | pkt_len = skb->len; |
80 | err = ip6_local_out(skb); | 79 | err = ip6_local_out(skb); |
81 | 80 | ||
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h index 94fe8fd07bc9..a0a4a100f5c9 100644 --- a/include/net/ip_tunnels.h +++ b/include/net/ip_tunnels.h | |||
@@ -148,7 +148,7 @@ static inline u8 ip_tunnel_ecn_encap(u8 tos, const struct iphdr *iph, | |||
148 | int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto); | 148 | int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto); |
149 | int iptunnel_xmit(struct rtable *rt, struct sk_buff *skb, | 149 | int iptunnel_xmit(struct rtable *rt, struct sk_buff *skb, |
150 | __be32 src, __be32 dst, __u8 proto, | 150 | __be32 src, __be32 dst, __u8 proto, |
151 | __u8 tos, __u8 ttl, __be16 df); | 151 | __u8 tos, __u8 ttl, __be16 df, bool xnet); |
152 | 152 | ||
153 | static inline void iptunnel_xmit_stats(int err, | 153 | static inline void iptunnel_xmit_stats(int err, |
154 | struct net_device_stats *err_stats, | 154 | struct net_device_stats *err_stats, |
diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c index b0e74e17088f..88d7d7d1eccb 100644 --- a/net/ipv4/ip_tunnel.c +++ b/net/ipv4/ip_tunnel.c | |||
@@ -614,9 +614,6 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, | |||
614 | goto tx_error; | 614 | goto tx_error; |
615 | } | 615 | } |
616 | 616 | ||
617 | if (!net_eq(tunnel->net, dev_net(dev))) | ||
618 | skb_scrub_packet(skb, true); | ||
619 | |||
620 | if (tunnel->err_count > 0) { | 617 | if (tunnel->err_count > 0) { |
621 | if (time_before(jiffies, | 618 | if (time_before(jiffies, |
622 | tunnel->err_time + IPTUNNEL_ERR_TIMEO)) { | 619 | tunnel->err_time + IPTUNNEL_ERR_TIMEO)) { |
@@ -655,7 +652,8 @@ void ip_tunnel_xmit(struct sk_buff *skb, struct net_device *dev, | |||
655 | } | 652 | } |
656 | 653 | ||
657 | err = iptunnel_xmit(rt, skb, fl4.saddr, fl4.daddr, protocol, | 654 | err = iptunnel_xmit(rt, skb, fl4.saddr, fl4.daddr, protocol, |
658 | ip_tunnel_ecn_encap(tos, inner_iph, skb), ttl, df); | 655 | ip_tunnel_ecn_encap(tos, inner_iph, skb), ttl, df, |
656 | !net_eq(tunnel->net, dev_net(dev))); | ||
659 | iptunnel_xmit_stats(err, &dev->stats, dev->tstats); | 657 | iptunnel_xmit_stats(err, &dev->stats, dev->tstats); |
660 | 658 | ||
661 | return; | 659 | return; |
diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c index e82045842351..d6c856b17fd4 100644 --- a/net/ipv4/ip_tunnel_core.c +++ b/net/ipv4/ip_tunnel_core.c | |||
@@ -48,16 +48,15 @@ | |||
48 | 48 | ||
49 | int iptunnel_xmit(struct rtable *rt, struct sk_buff *skb, | 49 | int iptunnel_xmit(struct rtable *rt, struct sk_buff *skb, |
50 | __be32 src, __be32 dst, __u8 proto, | 50 | __be32 src, __be32 dst, __u8 proto, |
51 | __u8 tos, __u8 ttl, __be16 df) | 51 | __u8 tos, __u8 ttl, __be16 df, bool xnet) |
52 | { | 52 | { |
53 | int pkt_len = skb->len; | 53 | int pkt_len = skb->len; |
54 | struct iphdr *iph; | 54 | struct iphdr *iph; |
55 | int err; | 55 | int err; |
56 | 56 | ||
57 | nf_reset(skb); | 57 | skb_scrub_packet(skb, xnet); |
58 | secpath_reset(skb); | 58 | |
59 | skb->rxhash = 0; | 59 | skb->rxhash = 0; |
60 | skb_dst_drop(skb); | ||
61 | skb_dst_set(skb, &rt->dst); | 60 | skb_dst_set(skb, &rt->dst); |
62 | memset(IPCB(skb), 0, sizeof(*IPCB(skb))); | 61 | memset(IPCB(skb), 0, sizeof(*IPCB(skb))); |
63 | 62 | ||
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 | ||
diff --git a/net/openvswitch/vport-gre.c b/net/openvswitch/vport-gre.c index 9b3713ef831e..c99dea543d64 100644 --- a/net/openvswitch/vport-gre.c +++ b/net/openvswitch/vport-gre.c | |||
@@ -179,7 +179,7 @@ static int gre_tnl_send(struct vport *vport, struct sk_buff *skb) | |||
179 | return iptunnel_xmit(rt, skb, fl.saddr, | 179 | return iptunnel_xmit(rt, skb, fl.saddr, |
180 | OVS_CB(skb)->tun_key->ipv4_dst, IPPROTO_GRE, | 180 | OVS_CB(skb)->tun_key->ipv4_dst, IPPROTO_GRE, |
181 | OVS_CB(skb)->tun_key->ipv4_tos, | 181 | OVS_CB(skb)->tun_key->ipv4_tos, |
182 | OVS_CB(skb)->tun_key->ipv4_ttl, df); | 182 | OVS_CB(skb)->tun_key->ipv4_ttl, df, false); |
183 | err_free_rt: | 183 | err_free_rt: |
184 | ip_rt_put(rt); | 184 | ip_rt_put(rt); |
185 | error: | 185 | error: |