diff options
Diffstat (limited to 'net/ipv6/sit.c')
-rw-r--r-- | net/ipv6/sit.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index 32e871a6c25a..b7a50e968506 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -6,8 +6,6 @@ | |||
6 | * Pedro Roque <roque@di.fc.ul.pt> | 6 | * Pedro Roque <roque@di.fc.ul.pt> |
7 | * Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> | 7 | * Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> |
8 | * | 8 | * |
9 | * $Id: sit.c,v 1.53 2001/09/25 05:09:53 davem Exp $ | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or | 9 | * This program is free software; you can redistribute it and/or |
12 | * modify it under the terms of the GNU General Public License | 10 | * modify it under the terms of the GNU General Public License |
13 | * as published by the Free Software Foundation; either version | 11 | * as published by the Free Software Foundation; either version |
@@ -493,13 +491,13 @@ static int ipip6_rcv(struct sk_buff *skb) | |||
493 | 491 | ||
494 | if ((tunnel->dev->priv_flags & IFF_ISATAP) && | 492 | if ((tunnel->dev->priv_flags & IFF_ISATAP) && |
495 | !isatap_chksrc(skb, iph, tunnel)) { | 493 | !isatap_chksrc(skb, iph, tunnel)) { |
496 | tunnel->stat.rx_errors++; | 494 | tunnel->dev->stats.rx_errors++; |
497 | read_unlock(&ipip6_lock); | 495 | read_unlock(&ipip6_lock); |
498 | kfree_skb(skb); | 496 | kfree_skb(skb); |
499 | return 0; | 497 | return 0; |
500 | } | 498 | } |
501 | tunnel->stat.rx_packets++; | 499 | tunnel->dev->stats.rx_packets++; |
502 | tunnel->stat.rx_bytes += skb->len; | 500 | tunnel->dev->stats.rx_bytes += skb->len; |
503 | skb->dev = tunnel->dev; | 501 | skb->dev = tunnel->dev; |
504 | dst_release(skb->dst); | 502 | dst_release(skb->dst); |
505 | skb->dst = NULL; | 503 | skb->dst = NULL; |
@@ -539,7 +537,7 @@ static inline __be32 try_6to4(struct in6_addr *v6dst) | |||
539 | static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | 537 | static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) |
540 | { | 538 | { |
541 | struct ip_tunnel *tunnel = netdev_priv(dev); | 539 | struct ip_tunnel *tunnel = netdev_priv(dev); |
542 | struct net_device_stats *stats = &tunnel->stat; | 540 | struct net_device_stats *stats = &tunnel->dev->stats; |
543 | struct iphdr *tiph = &tunnel->parms.iph; | 541 | struct iphdr *tiph = &tunnel->parms.iph; |
544 | struct ipv6hdr *iph6 = ipv6_hdr(skb); | 542 | struct ipv6hdr *iph6 = ipv6_hdr(skb); |
545 | u8 tos = tunnel->parms.iph.tos; | 543 | u8 tos = tunnel->parms.iph.tos; |
@@ -553,7 +551,7 @@ static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | |||
553 | int addr_type; | 551 | int addr_type; |
554 | 552 | ||
555 | if (tunnel->recursion++) { | 553 | if (tunnel->recursion++) { |
556 | tunnel->stat.collisions++; | 554 | stats->collisions++; |
557 | goto tx_error; | 555 | goto tx_error; |
558 | } | 556 | } |
559 | 557 | ||
@@ -620,20 +618,20 @@ static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | |||
620 | .oif = tunnel->parms.link, | 618 | .oif = tunnel->parms.link, |
621 | .proto = IPPROTO_IPV6 }; | 619 | .proto = IPPROTO_IPV6 }; |
622 | if (ip_route_output_key(dev_net(dev), &rt, &fl)) { | 620 | if (ip_route_output_key(dev_net(dev), &rt, &fl)) { |
623 | tunnel->stat.tx_carrier_errors++; | 621 | stats->tx_carrier_errors++; |
624 | goto tx_error_icmp; | 622 | goto tx_error_icmp; |
625 | } | 623 | } |
626 | } | 624 | } |
627 | if (rt->rt_type != RTN_UNICAST) { | 625 | if (rt->rt_type != RTN_UNICAST) { |
628 | ip_rt_put(rt); | 626 | ip_rt_put(rt); |
629 | tunnel->stat.tx_carrier_errors++; | 627 | stats->tx_carrier_errors++; |
630 | goto tx_error_icmp; | 628 | goto tx_error_icmp; |
631 | } | 629 | } |
632 | tdev = rt->u.dst.dev; | 630 | tdev = rt->u.dst.dev; |
633 | 631 | ||
634 | if (tdev == dev) { | 632 | if (tdev == dev) { |
635 | ip_rt_put(rt); | 633 | ip_rt_put(rt); |
636 | tunnel->stat.collisions++; | 634 | stats->collisions++; |
637 | goto tx_error; | 635 | goto tx_error; |
638 | } | 636 | } |
639 | 637 | ||
@@ -643,7 +641,7 @@ static int ipip6_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | |||
643 | mtu = skb->dst ? dst_mtu(skb->dst) : dev->mtu; | 641 | mtu = skb->dst ? dst_mtu(skb->dst) : dev->mtu; |
644 | 642 | ||
645 | if (mtu < 68) { | 643 | if (mtu < 68) { |
646 | tunnel->stat.collisions++; | 644 | stats->collisions++; |
647 | ip_rt_put(rt); | 645 | ip_rt_put(rt); |
648 | goto tx_error; | 646 | goto tx_error; |
649 | } | 647 | } |
@@ -920,11 +918,6 @@ done: | |||
920 | return err; | 918 | return err; |
921 | } | 919 | } |
922 | 920 | ||
923 | static struct net_device_stats *ipip6_tunnel_get_stats(struct net_device *dev) | ||
924 | { | ||
925 | return &(((struct ip_tunnel*)netdev_priv(dev))->stat); | ||
926 | } | ||
927 | |||
928 | static int ipip6_tunnel_change_mtu(struct net_device *dev, int new_mtu) | 921 | static int ipip6_tunnel_change_mtu(struct net_device *dev, int new_mtu) |
929 | { | 922 | { |
930 | if (new_mtu < IPV6_MIN_MTU || new_mtu > 0xFFF8 - sizeof(struct iphdr)) | 923 | if (new_mtu < IPV6_MIN_MTU || new_mtu > 0xFFF8 - sizeof(struct iphdr)) |
@@ -938,7 +931,6 @@ static void ipip6_tunnel_setup(struct net_device *dev) | |||
938 | dev->uninit = ipip6_tunnel_uninit; | 931 | dev->uninit = ipip6_tunnel_uninit; |
939 | dev->destructor = free_netdev; | 932 | dev->destructor = free_netdev; |
940 | dev->hard_start_xmit = ipip6_tunnel_xmit; | 933 | dev->hard_start_xmit = ipip6_tunnel_xmit; |
941 | dev->get_stats = ipip6_tunnel_get_stats; | ||
942 | dev->do_ioctl = ipip6_tunnel_ioctl; | 934 | dev->do_ioctl = ipip6_tunnel_ioctl; |
943 | dev->change_mtu = ipip6_tunnel_change_mtu; | 935 | dev->change_mtu = ipip6_tunnel_change_mtu; |
944 | 936 | ||