diff options
author | davem <davem> | 2002-01-12 07:39:45 +0000 |
---|---|---|
committer | davem <davem> | 2002-01-12 07:39:45 +0000 |
commit | 202e56c715578dcace4aa7537e824acfb65f43c1 (patch) | |
tree | e8fbf8fd3cac91b0ccb31b4b092acedd1b81c01d | |
parent | 06ce0a67f7f90b2b18d65c58a7886029aa501c2e (diff) | |
download | netdev-vger-cvs-202e56c715578dcace4aa7537e824acfb65f43c1.tar.gz |
Allow IP packets with payload shorter than
8 bytes.
-rw-r--r-- | net/ipv4/ip_input.c | 5 | ||||
-rw-r--r-- | net/ipv4/udp.c | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index 11f8b2ec2..41c679b05 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.54 2001-11-06 22:33:52 davem Exp $ + * Version: $Id: ip_input.c,v 1.55 2002-01-12 07:39:45 davem Exp $ * * Authors: Ross Biro, <bir7@leland.Stanford.Edu> * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> @@ -224,8 +224,7 @@ static inline int ip_local_deliver_finish(struct sk_buff *skb) nf_debug_ip_local_deliver(skb); #endif /*CONFIG_NETFILTER_DEBUG*/ - /* Pull out additionl 8 bytes to save some space in protocols. */ - if (!pskb_may_pull(skb, ihl+8)) + if (!pskb_may_pull(skb, ihl)) goto out; __skb_pull(skb, ihl); diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 87fba3ede..20ac76a06 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -5,7 +5,7 @@ * * The User Datagram Protocol (UDP). * - * Version: $Id: udp.c,v 1.100 2001-10-15 12:34:50 davem Exp $ + * Version: $Id: udp.c,v 1.101 2002-01-12 07:39:45 davem Exp $ * * Authors: Ross Biro, <bir7@leland.Stanford.Edu> * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> @@ -886,6 +886,9 @@ int udp_rcv(struct sk_buff *skb) /* * Validate the packet and the UDP length. */ + if (!pskb_may_pull(skb, sizeof(struct udphdr))) + goto no_header; + ulen = ntohs(skb->h.uh->len); if (ulen > len || ulen < sizeof(*uh)) @@ -926,6 +929,7 @@ int udp_rcv(struct sk_buff *skb) short_packet: NETDEBUG(if (net_ratelimit()) printk(KERN_DEBUG "UDP: short packet: %d/%d\n", ulen, len)); +no_header: UDP_INC_STATS_BH(UdpInErrors); kfree_skb(skb); return(0); |