Files
linux/net/ipv4
Panu Matilainen bbac8911f1 ipv4: Fix incorrect error code when adding an unreachable route
[ Upstream commit 49dd18ba46 ]

Trying to add an unreachable route incorrectly returns -ESRCH if
if custom FIB rules are present:

[root@localhost ~]# ip route add 74.125.31.199 dev eth0 via 1.2.3.4
RTNETLINK answers: Network is unreachable
[root@localhost ~]# ip rule add to 55.66.77.88 table 200
[root@localhost ~]# ip route add 74.125.31.199 dev eth0 via 1.2.3.4
RTNETLINK answers: No such process
[root@localhost ~]#

Commit 83886b6b63 ("[NET]: Change "not found"
return value for rule lookup") changed fib_rules_lookup()
to use -ESRCH as a "not found" code internally, but for user space it
should be translated into -ENETUNREACH. Handle the translation centrally in
ipv4-specific fib_lookup(), leaving the DECnet case alone.

On a related note, commit b7a71b51ee
("ipv4: removed redundant conditional") removed a similar translation from
ip_route_input_slow() prematurely AIUI.

Fixes: b7a71b51ee ("ipv4: removed redundant conditional")
Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-06 15:05:46 -08:00
..
2013-02-15 15:10:37 -05:00
2013-06-25 16:07:44 -07:00
2014-08-14 09:24:15 +08:00
2013-03-17 14:35:13 -04:00
2014-08-14 09:24:15 +08:00
2014-08-14 09:24:15 +08:00
2014-08-14 09:24:15 +08:00
2013-03-26 12:27:19 -04:00
2013-03-26 12:27:18 -04:00
2014-08-14 09:24:15 +08:00
2014-07-28 08:00:05 -07:00
2014-10-15 08:31:57 +02:00
2013-03-21 11:47:50 -04:00
2013-03-21 11:47:50 -04:00