[NET]: Fix zero-size datagram reception
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 2 Nov 2005 07:55:00 +0000 (18:55 +1100)
committerArnaldo Carvalho de Melo <acme@mandriva.com>
Thu, 3 Nov 2005 00:25:04 +0000 (22:25 -0200)
The recent rewrite of skb_copy_datagram_iovec broke the reception of
zero-size datagrams.  This patch fixes it.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
net/core/datagram.c

index 81987df536eb83f04d28da673806693589582993..d219435d086c8d9a4d619b26b2d131dd74f8686d 100644 (file)
@@ -213,6 +213,10 @@ int skb_copy_datagram_iovec(const struct sk_buff *skb, int offset,
 {
        int i, err, fraglen, end = 0;
        struct sk_buff *next = skb_shinfo(skb)->frag_list;
+
+       if (!len)
+               return 0;
+
 next_skb:
        fraglen = skb_headlen(skb);
        i = -1;