]> git.ipfire.org Git - thirdparty/systemd.git/commit - test/test-network/systemd-networkd-tests.py
network/dhcp4: always find suitable gateway for destination address
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 24 Jul 2023 11:40:04 +0000 (20:40 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 27 Jul 2023 20:45:51 +0000 (05:45 +0900)
commit0ce86f5eeb0921b44a9782260a8c88aafb15ffde
treedffb4e04e894c926d8acd9b1b1a43b6c946a90b0
parent0bc8b6e265e182830558a114a5b6bce349283d3a
network/dhcp4: always find suitable gateway for destination address

And if not found, refuse to configure the route.

If a DHCP server provides classless static or static routes, then we
should use the gateway for accessing a node in the range specified in
the route. E.g. if a DHCP server provides the default gateway is
192.168.0.1, and classless static route for 8.0.0.0/8 with gateway
192.168.0.2, then we should access 8.8.8.8 through 192.168.0.2 rather
than 192.168.0.1, but should use 192.168.0.1 for 9.9.9.9.

Fixes #28358.
src/network/networkd-dhcp4.c
test/test-network/systemd-networkd-tests.py