Re: UDP error handling inconsistencies

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 13, 2007 at 11:12:06AM +0200,  Gabriel Paubert wrote:
> A patch to restore pre-2.3.41 behaviour for IPv4 follows (and the 
> logic becomes much clearer IMO, not only because it avoids a goto), 
> but I'm not sure that it should be applied.
> 

It should not since it was buggy, the correct one follows (it was 
missing the test for inet->recverr in the last if ( ) statement).

	Regards,
	Gabriel

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 2835535..651637e 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -380,14 +380,13 @@ void __udp4_lib_err(struct sk_buff *skb, u32 info, struct hlist_head udptable[])
 	 *      RFC1122: OK.  Passes ICMP errors back to application, as per
 	 *	4.1.3.3.
 	 */
-	if (!inet->recverr) {
-		if (!harderr || sk->sk_state != TCP_ESTABLISHED)
-			goto out;
-	} else {
+	if (inet->recverr) {
 		ip_icmp_error(sk, skb, err, uh->dest, info, (u8*)(uh+1));
 	}
-	sk->sk_err = err;
-	sk->sk_error_report(sk);
+	if (inet->recverr || harderr || sk->sk_state == TCP_ESTABLISHED) {
+			sk->sk_err = err;
+			sk->sk_error_report(sk);
+	}
 out:
 	sock_put(sk);
 }
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux