]> git.baikalelectronics.ru Git - kernel.git/commit
nexthop: Pass nh_config to replace_nexthop()
authorPetr Machata <petrm@nvidia.com>
Thu, 11 Mar 2021 18:03:12 +0000 (19:03 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 Mar 2021 00:12:59 +0000 (16:12 -0800)
commit0c257b7156b7c23aeebec08217de368ab50a3687
tree4fdbbf76667fc27c2f1859e4fb9169c2bc7f15c2
parent6db7cfd1072c022c7f4802ba2685e0c6eb73a2e8
nexthop: Pass nh_config to replace_nexthop()

Currently, replace assumes that the new group that is given is a
fully-formed object. But mpath groups really only have one attribute, and
that is the constituent next hop configuration. This may not be universally
true. From the usability perspective, it is desirable to allow the replace
operation to adjust just the constituent next hop configuration and leave
the group attributes as such intact.

But the object that keeps track of whether an attribute was or was not
given is the nh_config object, not the next hop or next-hop group. To allow
(selective) attribute updates during NH group replacement, propagate `cfg'
to replace_nexthop() and further to replace_nexthop_grp().

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/nexthop.c