diff mbox

[1/1] ipv4: IP_RECVERR should also enqueue source quench messages

Message ID 1248219127-3203-1-git-send-email-hagen@jauu.net
State Rejected, archived
Delegated to: David Miller
Headers show

Commit Message

Hagen Paul Pfeifer July 21, 2009, 11:32 p.m. UTC
Currently ICMP source quench messages are silently dropped and not
enqueued in a per-socket error queue. The socket option IP_RECVERR
enables a connected datagram socket to notice error conditions received
via ICMP. This modification allows applications to notice ICMP source
quench error condition too.

Side note: source quench are obsolete since day ~0 and are one of the
early design mistakes of the Internet. Anyway, this does not interfere
with the fact that a connected socket should not be informed about
received source quench messages.

Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
---
 net/ipv4/raw.c |    3 ++-
 net/ipv4/udp.c |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

David Miller July 22, 2009, 3:07 a.m. UTC | #1
From: Hagen Paul Pfeifer <hagen@jauu.net>
Date: Wed, 22 Jul 2009 01:32:07 +0200

> Currently ICMP source quench messages are silently dropped and not
> enqueued in a per-socket error queue. The socket option IP_RECVERR
> enables a connected datagram socket to notice error conditions received
> via ICMP. This modification allows applications to notice ICMP source
> quench error condition too.
> 
> Side note: source quench are obsolete since day ~0 and are one of the
> early design mistakes of the Internet. Anyway, this does not interfere
> with the fact that a connected socket should not be informed about
> received source quench messages.
> 
> Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>

I'm almost entirely sure that this behavior is intentional.

All RFCs say to ignore source quench messages with impunity, and Linux
interprets this to mean for our userland interfaces too.

I'm not applying this, sorry.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andi Kleen July 22, 2009, 9:32 a.m. UTC | #2
David Miller <davem@davemloft.net> writes:
>
> I'm almost entirely sure that this behavior is intentional.

I could also imagine that changing it could break some existing
applications that do not expect to see source quenchs here.

-Andi
diff mbox

Patch

diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 2979f14..1d73953 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -229,7 +229,8 @@  static void raw_err(struct sock *sk, struct sk_buff *skb, u32 info)
 		err = EHOSTUNREACH;
 		break;
 	case ICMP_SOURCE_QUENCH:
-		return;
+		err = ENOBUFS;
+		break;
 	case ICMP_PARAMETERPROB:
 		err = EPROTO;
 		harderr = 1;
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 80e3812..ba4a4a8 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -409,7 +409,8 @@  void __udp4_lib_err(struct sk_buff *skb, u32 info, struct udp_table *udptable)
 		err = EHOSTUNREACH;
 		break;
 	case ICMP_SOURCE_QUENCH:
-		goto out;
+		err = ENOBUFS;
+		break;
 	case ICMP_PARAMETERPROB:
 		err = EPROTO;
 		harderr = 1;