summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2023-04-03 19:42:43 +0200
committerChristian Marangi <ansuelsmth@gmail.com>2023-04-03 21:19:25 +0200
commit2ea065f9e8334dc4632eb2671e5b1f5857949278 (patch)
tree250f0b7b282557744b3088340d14ab3a6b53c99b
parent4b38e6b5bb967f0ee2e378a9016a5adaaa90eba5 (diff)
Revert "config: recheck have_link_local on interface reload if already init"
This reverts commit 29c934d7ab98ca0b5da0e3757b885a1d3c19a2f4. Replace with a better more safe implementation. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
-rw-r--r--src/config.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/config.c b/src/config.c
index 85d77b0..6122fb1 100644
--- a/src/config.c
+++ b/src/config.c
@@ -594,21 +594,21 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
if (len > 0)
iface->addr6_len = len;
+ for (size_t i = 0; i < iface->addr6_len; i++) {
+ struct odhcpd_ipaddr *addr = &iface->addr6[i];
+
+ if (!addr->tentative) {
+ iface->have_link_local = true;
+ break;
+ }
+ }
+
len = netlink_get_interface_addrs(iface->ifindex,
false, &iface->addr4);
if (len > 0)
iface->addr4_len = len;
}
- for (size_t i = 0; i < iface->addr6_len; i++) {
- struct odhcpd_ipaddr *addr = &iface->addr6[i];
-
- if (!addr->tentative) {
- iface->have_link_local = true;
- break;
- }
- }
-
iface->inuse = true;
if ((c = tb[IFACE_ATTR_DYNAMICDHCP]))