]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
network/dhcp6: use address_can_update() at one more place
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 14 Feb 2024 04:27:00 +0000 (13:27 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 14 Feb 2024 04:59:04 +0000 (13:59 +0900)
In address_can_update(), only prefix length is checked for IPv6
addresses. So, this should not change any behavior.

src/network/networkd-address.c
src/network/networkd-address.h
src/network/networkd-dhcp6.c

index d1087c5f123dd239a72b55c81e4aef9a64a24837..2aa8c88bb2d763e5bccbc8d2095229c465baaa83 100644 (file)
@@ -516,7 +516,7 @@ static int address_compare_func(const Address *a1, const Address *a2) {
         }
 }
 
-static bool address_can_update(const Address *existing, const Address *requesting) {
+bool address_can_update(const Address *existing, const Address *requesting) {
         assert(existing);
         assert(requesting);
 
index cc2429094e701c7443cccc37034a9d59983ebe84..350d2f6b381184fa61b733d71717b0776cbe9c06 100644 (file)
@@ -85,6 +85,8 @@ void link_get_address_states(
 
 extern const struct hash_ops address_hash_ops;
 
+bool address_can_update(const Address *existing, const Address *requesting);
+
 Address* address_ref(Address *address);
 Address* address_unref(Address *address);
 
index eb1420be5c0691314bc45b174eb18e30466fbc29..de4588c93e0fdd758d88228bc001814288f21fd4 100644 (file)
@@ -158,8 +158,7 @@ static int verify_dhcp6_address(Link *link, const Address *address) {
         } else
                 log_level = LOG_DEBUG;
 
-        if (address->prefixlen == existing->prefixlen)
-                /* Currently, only conflict in prefix length is reported. */
+        if (address_can_update(existing, address))
                 goto simple_log;
 
         if (existing->source == NETWORK_CONFIG_SOURCE_NDISC)