diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-02-16 01:07:24 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-02-16 01:07:24 +0000 |
commit | 95db6b748fc86297827fbd9c9ef174d491c9ad89 (patch) | |
tree | 27a92a942821cde1edda9a1b088718d436b3efe4 /net/ipv4/ip_input.c | |
parent | 45b27b0a0652331d104c953a5b192d843fff88f8 (diff) |
Merge with Linux 2.3.40.
Diffstat (limited to 'net/ipv4/ip_input.c')
-rw-r--r-- | net/ipv4/ip_input.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index 4ebdbdfb4..11a8c319b 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c @@ -5,7 +5,7 @@ * * The Internet Protocol (IP) module. * - * Version: $Id: ip_input.c,v 1.42 1999/08/20 11:05:27 davem Exp $ + * Version: $Id: ip_input.c,v 1.44 2000/01/09 02:19:30 davem Exp $ * * Authors: Ross Biro, <bir7@leland.Stanford.Edu> * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> @@ -148,7 +148,7 @@ * SNMP management statistics */ -struct ip_mib ip_statistics={2,IPDEFTTL,}; /* Forwarding=No, Default TTL=64 */ +struct ip_mib ip_statistics[NR_CPUS*2]; /* * Process Router Attention IP option @@ -368,7 +368,7 @@ static inline int ip_rcv_finish(struct sk_buff *skb) return skb->dst->input(skb); inhdr_error: - ip_statistics.IpInHdrErrors++; + IP_INC_STATS_BH(IpInHdrErrors); drop: kfree_skb(skb); return(0); @@ -387,7 +387,7 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt) if (skb->pkt_type == PACKET_OTHERHOST) goto drop; - ip_statistics.IpInReceives++; + IP_INC_STATS_BH(IpInReceives); if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) goto out; @@ -403,14 +403,14 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt) * 4. Doesn't have a bogus length */ - if (skb->len < sizeof(struct iphdr)) + if (skb->len < sizeof(struct iphdr) || skb->len < (iph->ihl<<2)) goto inhdr_error; if (iph->ihl < 5 || iph->version != 4 || ip_fast_csum((u8 *)iph, iph->ihl) != 0) goto inhdr_error; { __u32 len = ntohs(iph->tot_len); - if (skb->len < len) + if (skb->len < len || len < (iph->ihl<<2)) goto inhdr_error; /* Our transport medium may have padded the buffer out. Now we know it @@ -424,7 +424,7 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt) ip_rcv_finish); inhdr_error: - ip_statistics.IpInHdrErrors++; + IP_INC_STATS_BH(IpInHdrErrors); drop: kfree_skb(skb); out: |