OSDN Git Service

ipv6: Change addrconf_f6i_alloc to use ip6_route_info_create
authorDavid Ahern <dsahern@gmail.com>
Thu, 21 Mar 2019 12:21:35 +0000 (05:21 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 21 Mar 2019 17:16:54 +0000 (10:16 -0700)
commitc7a1ce397adacaf5d4bb2eab0a738b5f80dc3e43
tree2abf4b6c8087a0daec60320bb46b029918f276b4
parent67f69513470382b1872b12f0db4446a5ab74389a
ipv6: Change addrconf_f6i_alloc to use ip6_route_info_create

Change addrconf_f6i_alloc to generate a fib6_config and call
ip6_route_info_create. addrconf_f6i_alloc is the last caller to
fib6_info_alloc besides ip6_route_info_create, and there is no
reason for it to do its own initialization on a fib6_info.

Host routes need to be created even if the device is down, so add a
new flag, fc_ignore_dev_down, to fib6_config and update fib6_nh_init
to not error out if device is not up.

Notes on the conversion:
- ip_fib_metrics_init is the same as fib6_config has fc_mx set to NULL
  and fc_mx_len set to 0
- dst_nocount is handled by the RTF_ADDRCONF flag
- dst_host is handled by fc_dst_len = 128

nh_gw does not get set after the conversion to ip6_route_info_create
but it should not be set in addrconf_f6i_alloc since this is a host
route not a gateway route.

Everything else is a straight forward map between fib6_info and
fib6_config.

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ip6_fib.h
net/ipv6/route.c