network: do not set nexthop ID, gateway, and multipath routes simultaneously
authorYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 29 Apr 2021 11:58:10 +0000 (20:58 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 29 Apr 2021 13:54:40 +0000 (22:54 +0900)
commit3c7f1c07572481288e7a6fbff22b0c353b1c72bc
tree4df53d9ce3a71cdaa55ba577b0beefac7e4ee26a
parent8a9ce525d1d5830c074451dd2b62865958ac7308
network: do not set nexthop ID, gateway, and multipath routes simultaneously

See kernel's rtm_to_fib_config() in net/ipv4/fib_frontend.c and
rtm_to_fib6_config() in net/ipv6/route.c.

Note that if both gateway and multipath routes are specified, then
kernel ignores gateway. So, strictly speaking, setting both gateway and
multipath routes is allowed by kernel. But such situation is mostly
user's misconfiguration. Let's refuse it.

Note that the conditions newly added in route_configure() are redundant,
as all static configurations are already verified in
route_section_verify(), and dynamic configurations do not set
nexthop_id or multipath routes. Just for safety.
src/network/networkd-route.c