patch-2.4.26 linux-2.4.26/net/ipv6/udp.c

Next file: linux-2.4.26/net/netsyms.c
Previous file: linux-2.4.26/net/ipv6/tcp_ipv6.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.25/net/ipv6/udp.c linux-2.4.26/net/ipv6/udp.c
@@ -400,6 +400,7 @@
 	if (flags & MSG_ERRQUEUE)
 		return ipv6_recv_error(sk, msg, len);
 
+try_again:
 	skb = skb_recv_datagram(sk, flags, noblock, &err);
 	if (!skb)
 		goto out;
@@ -476,12 +477,13 @@
 			kfree_skb(skb);
 	}
 
-	/* Error for blocking case is chosen to masquerade
-	   as some normal condition.
-	 */
-	err = (flags&MSG_DONTWAIT) ? -EAGAIN : -EHOSTUNREACH;
-	UDP6_INC_STATS_USER(UdpInErrors);
-	goto out_free;
+	skb_free_datagram(sk, skb);
+
+	if (flags & MSG_DONTWAIT) {
+		UDP6_INC_STATS_USER(UdpInErrors);
+		return -EAGAIN;
+	}
+	goto try_again;
 }
 
 void udpv6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)