From: Herbert Xu Date: Wed, 2 Nov 2005 07:55:00 +0000 (+1100) Subject: [NET]: Fix zero-size datagram reception X-Git-Tag: v2.6.15-rc1~452^2~26^2~2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c75d721c761ad0f2d8725c40af9e4f376efefd24;p=linux-2.6 [NET]: Fix zero-size datagram reception The recent rewrite of skb_copy_datagram_iovec broke the reception of zero-size datagrams. This patch fixes it. Signed-off-by: Herbert Xu Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/net/core/datagram.c b/net/core/datagram.c index 81987df536..d219435d08 100644 --- a/net/core/datagram.c +++ b/net/core/datagram.c @@ -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;