commit 830218c1add1da16519b71909e5cf21522b7d062 upstream.
rt6_add_route_info and rt6_add_dflt_router were updated to pull the FIB
table from the device index, but the corresponding rt6_get_route_info
and rt6_get_dflt_router functions were not leading to the failure to
process RA's:
ICMPv6: RA: ndisc_router_discovery failed to add default route
Fix the 'get' functions by using the table id associated with the
device when applicable.
Backported to 4.4 after
6dd69fdc00 "net: ipv6: autoconf routes into per-device tables"
which caused the conflicts due to which this had initially been reverted.
Resolved conflicts:
- Signatures and call sites already use `struct net_device`
instead of `struct net` and `ifindex`
- The flag and the cleanup code using it are no longer required as
`fib6_clean_all` is used to iterate over all tables.
- `l3mdev_fib_table_by_index` replaced by `l3mdev_fib_table`
(prior incompletely resolved merge conflict)
- Use `RT6_TABLE_DFLT` instead of `RT6_TABLE_MAIN` in
`rt6_get_dflt_router` (similar prior conflict as above)
Fixes: ca254490c8 ("net: Add VRF support to IPv6 stack")
Fixes: 6dd69fdc00 ("net: ipv6: autoconf routes into per-device tables")
Change-Id: I9b95895f840c89dc989986d4c12f5d4cc077e047