aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/ip6_gre.c9
-rw-r--r--net/ipv6/ip6_tunnel.c11
-rw-r--r--net/ipv6/ip6mr.c3
-rw-r--r--net/ipv6/ndisc.c2
-rw-r--r--net/ipv6/sit.c13
-rw-r--r--net/ipv6/tcp_ipv6.c3
6 files changed, 10 insertions, 31 deletions
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index f2d0a42f8057..db992a373011 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -509,8 +509,6 @@ static int ip6gre_rcv(struct sk_buff *skb)
509 goto drop; 509 goto drop;
510 } 510 }
511 511
512 secpath_reset(skb);
513
514 skb->protocol = gre_proto; 512 skb->protocol = gre_proto;
515 /* WCCP version 1 and 2 protocol decoding. 513 /* WCCP version 1 and 2 protocol decoding.
516 * - Change protocol to IP 514 * - Change protocol to IP
@@ -525,7 +523,6 @@ static int ip6gre_rcv(struct sk_buff *skb)
525 skb->mac_header = skb->network_header; 523 skb->mac_header = skb->network_header;
526 __pskb_pull(skb, offset); 524 __pskb_pull(skb, offset);
527 skb_postpull_rcsum(skb, skb_transport_header(skb), offset); 525 skb_postpull_rcsum(skb, skb_transport_header(skb), offset);
528 skb->pkt_type = PACKET_HOST;
529 526
530 if (((flags&GRE_CSUM) && csum) || 527 if (((flags&GRE_CSUM) && csum) ||
531 (!(flags&GRE_CSUM) && tunnel->parms.i_flags&GRE_CSUM)) { 528 (!(flags&GRE_CSUM) && tunnel->parms.i_flags&GRE_CSUM)) {
@@ -557,7 +554,7 @@ static int ip6gre_rcv(struct sk_buff *skb)
557 skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN); 554 skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN);
558 } 555 }
559 556
560 __skb_tunnel_rx(skb, tunnel->dev); 557 __skb_tunnel_rx(skb, tunnel->dev, tunnel->net);
561 558
562 skb_reset_network_header(skb); 559 skb_reset_network_header(skb);
563 560
@@ -694,6 +691,8 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb,
694 tunnel->err_count = 0; 691 tunnel->err_count = 0;
695 } 692 }
696 693
694 skb_scrub_packet(skb, !net_eq(tunnel->net, dev_net(dev)));
695
697 max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen + dst->header_len; 696 max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen + dst->header_len;
698 697
699 if (skb_headroom(skb) < max_headroom || skb_shared(skb) || 698 if (skb_headroom(skb) < max_headroom || skb_shared(skb) ||
@@ -710,8 +709,6 @@ static netdev_tx_t ip6gre_xmit2(struct sk_buff *skb,
710 skb = new_skb; 709 skb = new_skb;
711 } 710 }
712 711
713 skb_dst_drop(skb);
714
715 if (fl6->flowi6_mark) { 712 if (fl6->flowi6_mark) {
716 skb_dst_set(skb, dst); 713 skb_dst_set(skb, dst);
717 ndst = NULL; 714 ndst = NULL;
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index d6e00a39274c..55999d923f26 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -802,14 +802,12 @@ static int ip6_tnl_rcv(struct sk_buff *skb, __u16 protocol,
802 rcu_read_unlock(); 802 rcu_read_unlock();
803 goto discard; 803 goto discard;
804 } 804 }
805 secpath_reset(skb);
806 skb->mac_header = skb->network_header; 805 skb->mac_header = skb->network_header;
807 skb_reset_network_header(skb); 806 skb_reset_network_header(skb);
808 skb->protocol = htons(protocol); 807 skb->protocol = htons(protocol);
809 skb->pkt_type = PACKET_HOST;
810 memset(skb->cb, 0, sizeof(struct inet6_skb_parm)); 808 memset(skb->cb, 0, sizeof(struct inet6_skb_parm));
811 809
812 __skb_tunnel_rx(skb, t->dev); 810 __skb_tunnel_rx(skb, t->dev, t->net);
813 811
814 err = dscp_ecn_decapsulate(t, ipv6h, skb); 812 err = dscp_ecn_decapsulate(t, ipv6h, skb);
815 if (unlikely(err)) { 813 if (unlikely(err)) {
@@ -829,9 +827,6 @@ static int ip6_tnl_rcv(struct sk_buff *skb, __u16 protocol,
829 tstats->rx_packets++; 827 tstats->rx_packets++;
830 tstats->rx_bytes += skb->len; 828 tstats->rx_bytes += skb->len;
831 829
832 if (!net_eq(t->net, dev_net(t->dev)))
833 skb_scrub_packet(skb);
834
835 netif_rx(skb); 830 netif_rx(skb);
836 831
837 rcu_read_unlock(); 832 rcu_read_unlock();
@@ -1001,8 +996,7 @@ static int ip6_tnl_xmit2(struct sk_buff *skb,
1001 goto tx_err_dst_release; 996 goto tx_err_dst_release;
1002 } 997 }
1003 998
1004 if (!net_eq(t->net, dev_net(dev))) 999 skb_scrub_packet(skb, !net_eq(t->net, dev_net(dev)));
1005 skb_scrub_packet(skb);
1006 1000
1007 /* 1001 /*
1008 * Okay, now see if we can stuff it in the buffer as-is. 1002 * Okay, now see if we can stuff it in the buffer as-is.
@@ -1021,7 +1015,6 @@ static int ip6_tnl_xmit2(struct sk_buff *skb,
1021 consume_skb(skb); 1015 consume_skb(skb);
1022 skb = new_skb; 1016 skb = new_skb;
1023 } 1017 }
1024 skb_dst_drop(skb);
1025 if (fl6->flowi6_mark) { 1018 if (fl6->flowi6_mark) {
1026 skb_dst_set(skb, dst); 1019 skb_dst_set(skb, dst);
1027 ndst = NULL; 1020 ndst = NULL;
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index a60a84ef04f7..f365310bfcca 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -672,9 +672,8 @@ static int pim6_rcv(struct sk_buff *skb)
672 skb_reset_network_header(skb); 672 skb_reset_network_header(skb);
673 skb->protocol = htons(ETH_P_IPV6); 673 skb->protocol = htons(ETH_P_IPV6);
674 skb->ip_summed = CHECKSUM_NONE; 674 skb->ip_summed = CHECKSUM_NONE;
675 skb->pkt_type = PACKET_HOST;
676 675
677 skb_tunnel_rx(skb, reg_dev); 676 skb_tunnel_rx(skb, reg_dev, dev_net(reg_dev));
678 677
679 netif_rx(skb); 678 netif_rx(skb);
680 679
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 14bd2f9d9dbb..22210650596f 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -662,9 +662,7 @@ static void ndisc_solicit(struct neighbour *neigh, struct sk_buff *skb)
662 } 662 }
663 ndisc_send_ns(dev, neigh, target, target, saddr); 663 ndisc_send_ns(dev, neigh, target, target, saddr);
664 } else if ((probes -= neigh->parms->app_probes) < 0) { 664 } else if ((probes -= neigh->parms->app_probes) < 0) {
665#ifdef CONFIG_ARPD
666 neigh_app_ns(neigh); 665 neigh_app_ns(neigh);
667#endif
668 } else { 666 } else {
669 addrconf_addr_solict_mult(target, &mcaddr); 667 addrconf_addr_solict_mult(target, &mcaddr);
670 ndisc_send_ns(dev, NULL, target, &mcaddr, saddr); 668 ndisc_send_ns(dev, NULL, target, &mcaddr, saddr);
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
index f18f842ac893..19abcc9d6a1a 100644
--- a/net/ipv6/sit.c
+++ b/net/ipv6/sit.c
@@ -581,12 +581,10 @@ static int ipip6_rcv(struct sk_buff *skb)
581 tunnel->parms.iph.protocol != 0) 581 tunnel->parms.iph.protocol != 0)
582 goto out; 582 goto out;
583 583
584 secpath_reset(skb);
585 skb->mac_header = skb->network_header; 584 skb->mac_header = skb->network_header;
586 skb_reset_network_header(skb); 585 skb_reset_network_header(skb);
587 IPCB(skb)->flags = 0; 586 IPCB(skb)->flags = 0;
588 skb->protocol = htons(ETH_P_IPV6); 587 skb->protocol = htons(ETH_P_IPV6);
589 skb->pkt_type = PACKET_HOST;
590 588
591 if (tunnel->dev->priv_flags & IFF_ISATAP) { 589 if (tunnel->dev->priv_flags & IFF_ISATAP) {
592 if (!isatap_chksrc(skb, iph, tunnel)) { 590 if (!isatap_chksrc(skb, iph, tunnel)) {
@@ -603,7 +601,7 @@ static int ipip6_rcv(struct sk_buff *skb)
603 } 601 }
604 } 602 }
605 603
606 __skb_tunnel_rx(skb, tunnel->dev); 604 __skb_tunnel_rx(skb, tunnel->dev, tunnel->net);
607 605
608 err = IP_ECN_decapsulate(iph, skb); 606 err = IP_ECN_decapsulate(iph, skb);
609 if (unlikely(err)) { 607 if (unlikely(err)) {
@@ -621,8 +619,6 @@ static int ipip6_rcv(struct sk_buff *skb)
621 tstats->rx_packets++; 619 tstats->rx_packets++;
622 tstats->rx_bytes += skb->len; 620 tstats->rx_bytes += skb->len;
623 621
624 if (!net_eq(tunnel->net, dev_net(tunnel->dev)))
625 skb_scrub_packet(skb);
626 netif_rx(skb); 622 netif_rx(skb);
627 623
628 return 0; 624 return 0;
@@ -860,9 +856,6 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
860 tunnel->err_count = 0; 856 tunnel->err_count = 0;
861 } 857 }
862 858
863 if (!net_eq(tunnel->net, dev_net(dev)))
864 skb_scrub_packet(skb);
865
866 /* 859 /*
867 * Okay, now see if we can stuff it in the buffer as-is. 860 * Okay, now see if we can stuff it in the buffer as-is.
868 */ 861 */
@@ -888,8 +881,8 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
888 ttl = iph6->hop_limit; 881 ttl = iph6->hop_limit;
889 tos = INET_ECN_encapsulate(tos, ipv6_get_dsfield(iph6)); 882 tos = INET_ECN_encapsulate(tos, ipv6_get_dsfield(iph6));
890 883
891 err = iptunnel_xmit(dev_net(dev), rt, skb, fl4.saddr, fl4.daddr, 884 err = iptunnel_xmit(rt, skb, fl4.saddr, fl4.daddr, IPPROTO_IPV6, tos,
892 IPPROTO_IPV6, tos, ttl, df); 885 ttl, df, !net_eq(tunnel->net, dev_net(dev)));
893 iptunnel_xmit_stats(err, &dev->stats, dev->tstats); 886 iptunnel_xmit_stats(err, &dev->stats, dev->tstats);
894 return NETDEV_TX_OK; 887 return NETDEV_TX_OK;
895 888
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 5bcfadf09e95..9acdcedf9a14 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1360,8 +1360,7 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)
1360 } 1360 }
1361 } 1361 }
1362 1362
1363 if (tcp_rcv_established(sk, skb, tcp_hdr(skb), skb->len)) 1363 tcp_rcv_established(sk, skb, tcp_hdr(skb), skb->len);
1364 goto reset;
1365 if (opt_skb) 1364 if (opt_skb)
1366 goto ipv6_pktoptions; 1365 goto ipv6_pktoptions;
1367 return 0; 1366 return 0;