Eric Dumazet fc75fc8339 ipv4: dont create routes on down devices
In ip_route_output_slow(), instead of allowing a route to be created on
a not UPed device, report -ENETUNREACH immediately.

# ip tunnel add mode ipip remote 10.16.0.164 local
10.16.0.72 dev eth0
# (Note : tunl1 is down)
# ping -I tunl1 10.1.2.3
PING 10.1.2.3 (10.1.2.3) from 192.168.18.5 tunl1: 56(84) bytes of data.
(nothing)
# ./a.out tunl1
# ip tunnel del tunl1
Message from syslogd@shelby at Dec 22 10:12:08 ...
  kernel: unregister_netdevice: waiting for tunl1 to become free.
Usage count = 3

After patch:
# ping -I tunl1 10.1.2.3
connect: Network is unreachable

Reported-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Reviewed-by: Octavian Purdila <opurdila@ixiacom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-12-25 20:05:31 -08:00
..
2010-09-23 14:33:39 -07:00
2010-02-22 16:20:22 -08:00
2010-10-25 13:09:45 -07:00
2010-11-09 08:26:42 -08:00
2010-10-27 11:37:33 -07:00
2010-09-23 14:33:39 -07:00
2010-10-30 16:21:28 -07:00
2010-06-28 23:24:29 -07:00
2010-02-22 16:20:22 -08:00
2010-10-03 21:50:53 -07:00
2010-08-19 00:08:30 -07:00
2010-06-26 22:00:03 -07:00
2009-03-02 03:00:15 -08:00
2009-03-02 03:00:15 -08:00
2010-11-10 12:12:00 -08:00
2010-12-23 09:32:46 -08:00
2009-05-25 22:44:59 -07:00
2010-09-23 14:33:39 -07:00
2010-10-27 11:37:32 -07:00
2010-07-12 12:57:54 -07:00