network/ndisc: do not override conflicting static routes
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 23 Jun 2024 05:36:08 +0000 (14:36 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 24 Jun 2024 17:46:08 +0000 (02:46 +0900)
commit7af3e8cd0034a6eb2e614b052c94c6d0b4556e98
tree3e711174980b482beba20bbaf8be836c8a6412bf
parent21ab3f505a46ef2bc1ea06e0002b3356974c0136
network/ndisc: do not override conflicting static routes

We have already ignored conflicting address configurations requested by
NDisc protocol. See ndisc_request_address().
Let's follow the same rule for routes. That is, if there are conflicting
static routes configured or requested, do not override them by NDisc.

Also, swap the order of checking existing route and existing request.

Fixes a regression caused by 972f1d17ab461a51142a142609dd3ec50bae8440.
Prompted by #33346.
src/network/networkd-ndisc.c