diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2017-09-26 00:33:58 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2017-09-26 00:33:58 +0200 |
commit | 7e3ec78468c108be00fa13e8b3d4e2f0c4ebbf42 (patch) | |
tree | 7bbf2611801ccd6c97f3bc8d26b4eb095869fd3f /pfinet/linux-src | |
parent | 56957059d60d87e21d2369ffa9b017f9acc14458 (diff) | |
download | hurd-7e3ec78468c108be00fa13e8b3d4e2f0c4ebbf42.tar.gz hurd-7e3ec78468c108be00fa13e8b3d4e2f0c4ebbf42.tar.bz2 hurd-7e3ec78468c108be00fa13e8b3d4e2f0c4ebbf42.zip |
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.
Diffstat (limited to 'pfinet/linux-src')
-rw-r--r-- | pfinet/linux-src/net/ipv4/udp.c | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/pfinet/linux-src/net/ipv4/udp.c b/pfinet/linux-src/net/ipv4/udp.c index ff5812a9..36dc801a 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); } |