commit-hurd
[Top][All Lists]
Advanced

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

[hurd] 08/10: pfinet: Avoid returning udp errors unless requested


From: Samuel Thibault
Subject: [hurd] 08/10: pfinet: Avoid returning udp errors unless requested
Date: Sun, 19 Nov 2017 15:27:17 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch upstream
in repository hurd.

commit 7e3ec78468c108be00fa13e8b3d4e2f0c4ebbf42
Author: Samuel Thibault <address@hidden>
Date:   Tue Sep 26 00:33:58 2017 +0200

    pfinet: Avoid returning udp errors unless requested
    
    This comes from Linux 2.3.40 to 2.3.41 changes, to fix its behavior
    according to common practice.  Unconnected udp sockets notably should
    not report errors, since the application doesn't have a way to relate it
    with previous sends.
---
 pfinet/linux-src/net/ipv4/udp.c | 27 ++++++---------------------
 1 file changed, 6 insertions(+), 21 deletions(-)

diff --git a/pfinet/linux-src/net/ipv4/udp.c b/pfinet/linux-src/net/ipv4/udp.c
index ff5812a..36dc801 100644
--- a/pfinet/linux-src/net/ipv4/udp.c
+++ b/pfinet/linux-src/net/ipv4/udp.c
@@ -467,30 +467,15 @@ void udp_err(struct sk_buff *skb, unsigned char *dp, int 
len)
        }
 
        /*
-        *      Various people wanted BSD UDP semantics. Well they've come
-        *      back out because they slow down response to stuff like dead
-        *      or unreachable name servers and they screw term users something
-        *      chronic. Oh and it violates RFC1122. So basically fix your
-        *      client code people.
-        */
-
-       /*
         *      RFC1122: OK.  Passes ICMP errors back to application, as per
-        *      4.1.3.3. After the comment above, that should be no surprise.
+        *      4.1.3.3.
         */
-
-       if (!harderr && !sk->ip_recverr)
-               return;
-
-       /*
-        *      4.x BSD compatibility item. Break RFC1122 to
-        *      get BSD socket semantics.
-        */
-       if(sk->bsdism && sk->state!=TCP_ESTABLISHED)
-               return;
-
-       if (sk->ip_recverr)
+       if (!sk->ip_recverr) {
+               if (!harderr || sk->state != TCP_ESTABLISHED)
+                       return;
+       } else {
                ip_icmp_error(sk, skb, err, uh->dest, info, (u8*)(uh+1));
+       }
        sk->err = err;
        sk->error_report(sk);
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]