Files
Alexander Grund 1518f4cff6 BACKPORT: net: ipv6: Fix processing of RAs in presence of VRF
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
2023-12-13 15:55:09 +08:00
..
2020-11-24 18:10:35 -07:00
2020-03-11 08:15:49 +01:00
2022-02-03 10:00:04 +01:00
2022-01-11 13:59:43 +01:00
2021-06-03 08:22:08 +02:00
2020-05-10 10:26:23 +02:00
2020-05-10 10:26:23 +02:00