network/dhcp4: do not set gateway if DNS server or friends is in the acquired prefix
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 10 May 2024 03:49:50 +0000 (12:49 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 10 May 2024 04:46:39 +0000 (13:46 +0900)
commit0f3116f039ca997156038c317011866011298a3f
tree82c7aa1433c18376a1e99617b1bf5c82daf1562f
parent4591efffc05529e1c6d51468954fda98d0cd5cba
network/dhcp4: do not set gateway if DNS server or friends is in the acquired prefix

Previously, even if a DNS server is in the acquired prefix, the route to the
server might have gateway address.
This makes the prefix route, which is always configured, is also handled
as same as static routes, and do not use any gateway if the prefix route
is the most suitable route to access the destination.
The same change is also applied to route to NTP servers and semi-static
routes.

Fixes a regression introduced by 0ce86f5eeb0921b44a9782260a8c88aafb15ffde.

Fixes #32715.
src/network/networkd-dhcp4.c