ipv6: fix handling of throw routes
authorNicolas Dichtel <nicolas.dichtel@6wind.com>
Thu, 6 Sep 2012 05:53:35 +0000 (05:53 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 7 Sep 2012 18:17:10 +0000 (14:17 -0400)
commitb4949ab269a20e9af9a0c40729bac56e8f8a43a2
tree201086f7d10ad9e854b909804c0a25bc6d69b65e
parent7ab4551f3b391818e29263279031dca1e26417c6
ipv6: fix handling of throw routes

It's the same problem that previous fix about blackhole and prohibit routes.

When adding a throw route, it was handled like a classic route.
Moreover, it was only possible to add this kind of routes by specifying
an interface.

Before the patch:
  $ ip route add throw 2001::2/128
  RTNETLINK answers: No such device
  $ ip route add throw 2001::2/128 dev eth0
  $ ip -6 route | grep 2001::2
  2001::2 dev eth0  metric 1024

After:
  $ ip route add throw 2001::2/128
  $ ip -6 route | grep 2001::2
  throw 2001::2 dev lo  metric 1024  error -11

Reported-by: Markus Stenberg <markus.stenberg@iki.fi>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv6/route.c