Re: [PATCH] [IPv4] Reply net unreachable ICMP message
From: Mitsuru Chinen <hidden>
Date: 2007-12-07 04:24:13
On Thu, 6 Dec 2007 09:47:33 +0100 Jarek Poplawski [off-list ref] wrote:
On 06-12-2007 09:14, Mitsuru Chinen wrote:quoted
On Thu, 6 Dec 2007 08:49:47 +0100 Jarek Poplawski [off-list ref] wrote:quoted
On 06-12-2007 07:31, Mitsuru Chinen wrote:quoted
IPv4 stack doesn't reply any ICMP destination unreachable message with net unreachable code when IP detagrams are being discarded because of no route could be found in the forwarding path. Incidentally, IPv6 stack replies such ICMPv6 message in the similar situation....quoted
quoted
This patch seems to be wrong. It overrides err codes from fib_lookup, where such decisions should be made.fib_lookup() replies -ESRCH in this situation. It is necessary to override the variable by the suitable error number like the code under e_hostunreach label.Probably I miss something, but I can't see how can you be sure it's only -ESRCH possible here? Isn't opt->action() in fib_rules_lookup() supposed to return this -ENETUNREACH when needed?
Oh, excuse me. I did mistake. fib_rules_lookup() replies -ESRCH when no route is found. The case it replies -ENETUNREACH is that user adds unreachable route. However, if the err value is override with no check, a blackhole or prohibit route is treated as a unreachable route. As the patch is already applied, I will send another patch to add a check for it. Thank you very much for pointing out the issue! Best Regards, ---- Mitsuru Chinen [off-list ref]