Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 102602
b: refs/heads/master
c: addd68e
h: refs/heads/master
v: v3
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed May 21, 2008
1 parent a66368d commit 9ff81bf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a339f1c881fdb8092ef9b118610307e10e885fc8
refs/heads/master: addd68eb6fe6f10017974947c90cc85ab2848cf2
32 changes: 14 additions & 18 deletions trunk/net/ipv4/ip_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,8 @@ static int ipgre_rcv(struct sk_buff *skb)
read_lock(&ipgre_lock);
if ((tunnel = ipgre_tunnel_lookup(dev_net(skb->dev),
iph->saddr, iph->daddr, key)) != NULL) {
struct net_device_stats *stats = &tunnel->dev->stats;

secpath_reset(skb);

skb->protocol = *(__be16*)(h + 2);
Expand All @@ -641,28 +643,28 @@ static int ipgre_rcv(struct sk_buff *skb)
/* Looped back packet, drop it! */
if (skb->rtable->fl.iif == 0)
goto drop;
tunnel->stat.multicast++;
stats->multicast++;
skb->pkt_type = PACKET_BROADCAST;
}
#endif

if (((flags&GRE_CSUM) && csum) ||
(!(flags&GRE_CSUM) && tunnel->parms.i_flags&GRE_CSUM)) {
tunnel->stat.rx_crc_errors++;
tunnel->stat.rx_errors++;
stats->rx_crc_errors++;
stats->rx_errors++;
goto drop;
}
if (tunnel->parms.i_flags&GRE_SEQ) {
if (!(flags&GRE_SEQ) ||
(tunnel->i_seqno && (s32)(seqno - tunnel->i_seqno) < 0)) {
tunnel->stat.rx_fifo_errors++;
tunnel->stat.rx_errors++;
stats->rx_fifo_errors++;
stats->rx_errors++;
goto drop;
}
tunnel->i_seqno = seqno + 1;
}
tunnel->stat.rx_packets++;
tunnel->stat.rx_bytes += skb->len;
stats->rx_packets++;
stats->rx_bytes += skb->len;
skb->dev = tunnel->dev;
dst_release(skb->dst);
skb->dst = NULL;
Expand All @@ -684,7 +686,7 @@ static int ipgre_rcv(struct sk_buff *skb)
static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct ip_tunnel *tunnel = netdev_priv(dev);
struct net_device_stats *stats = &tunnel->stat;
struct net_device_stats *stats = &tunnel->dev->stats;
struct iphdr *old_iph = ip_hdr(skb);
struct iphdr *tiph;
u8 tos;
Expand All @@ -698,7 +700,7 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
int mtu;

if (tunnel->recursion++) {
tunnel->stat.collisions++;
stats->collisions++;
goto tx_error;
}

Expand All @@ -714,7 +716,7 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
/* NBMA tunnel */

if (skb->dst == NULL) {
tunnel->stat.tx_fifo_errors++;
stats->tx_fifo_errors++;
goto tx_error;
}

Expand Down Expand Up @@ -765,15 +767,15 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
.tos = RT_TOS(tos) } },
.proto = IPPROTO_GRE };
if (ip_route_output_key(dev_net(dev), &rt, &fl)) {
tunnel->stat.tx_carrier_errors++;
stats->tx_carrier_errors++;
goto tx_error;
}
}
tdev = rt->u.dst.dev;

if (tdev == dev) {
ip_rt_put(rt);
tunnel->stat.collisions++;
stats->collisions++;
goto tx_error;
}

Expand Down Expand Up @@ -1098,11 +1100,6 @@ ipgre_tunnel_ioctl (struct net_device *dev, struct ifreq *ifr, int cmd)
return err;
}

static struct net_device_stats *ipgre_tunnel_get_stats(struct net_device *dev)
{
return &(((struct ip_tunnel*)netdev_priv(dev))->stat);
}

static int ipgre_tunnel_change_mtu(struct net_device *dev, int new_mtu)
{
struct ip_tunnel *tunnel = netdev_priv(dev);
Expand Down Expand Up @@ -1228,7 +1225,6 @@ static void ipgre_tunnel_setup(struct net_device *dev)
dev->uninit = ipgre_tunnel_uninit;
dev->destructor = free_netdev;
dev->hard_start_xmit = ipgre_tunnel_xmit;
dev->get_stats = ipgre_tunnel_get_stats;
dev->do_ioctl = ipgre_tunnel_ioctl;
dev->change_mtu = ipgre_tunnel_change_mtu;

Expand Down

0 comments on commit 9ff81bf

Please sign in to comment.