ipv6: use rt6_get_dflt_router to get default router in rt6_route_rcv
authorDuan Jiong <duanj.fnst@cn.fujitsu.com>
Fri, 8 Nov 2013 01:56:53 +0000 (09:56 +0800)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 3 Jan 2014 04:33:32 +0000 (04:33 +0000)
commit088ab1d96adc0e00ade2d246ea3d8304b3ce887f
tree1af2961dae8204bf9a5109c19bfd113273ed0c1d
parent6b23a9a0fbd5ec9a6b5d0034156134864adaf768
ipv6: use rt6_get_dflt_router to get default router in rt6_route_rcv

[ Upstream commit f104a567e673f382b09542a8dc3500aa689957b4 ]

As the rfc 4191 said, the Router Preference and Lifetime values in a
::/0 Route Information Option should override the preference and lifetime
values in the Router Advertisement header. But when the kernel deals with
a ::/0 Route Information Option, the rt6_get_route_info() always return
NULL, that means that overriding will not happen, because those default
routers were added without flag RTF_ROUTEINFO in rt6_add_dflt_router().

In order to deal with that condition, we should call rt6_get_dflt_router
when the prefix length is 0.

Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/ipv6/route.c