network/dhcp4: introduce dhcp4_get_router() helper function
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 24 Jul 2023 10:47:06 +0000 (19:47 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 27 Jul 2023 20:18:24 +0000 (05:18 +0900)
commit15aa7a5c3d141f618d7c6db48f16ecab6b53bd1a
tree3989e34af86e0ef0910c34a5f3f9562c714cdc2d
parentd52c5a72fefefdeb754264edde557801ce045e12
network/dhcp4: introduce dhcp4_get_router() helper function

Previously, we use the first router address, and if it is null, we
ignore the address. Now, we use the first non-null address. That is, if
the first router address is null, but the second is not, then we use the
second one.

That should not cause functional change in most cases, except for the case
when a DHCP server provides such spurious reply.

This is mostly for refactoring and preparation for later commits.
src/network/networkd-dhcp4.c