From 7e3ec78468c108be00fa13e8b3d4e2f0c4ebbf42 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Tue, 26 Sep 2017 00:33:58 +0200 Subject: 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(-) (limited to 'pfinet/linux-src') 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 @@ -466,31 +466,16 @@ void udp_err(struct sk_buff *skb, unsigned char *dp, int len) break; } - /* - * 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); } -- cgit v1.2.3