summaryrefslogtreecommitdiffhomepage
path: root/src/config.c
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2023-03-16 23:44:43 +0100
committerChristian Marangi <ansuelsmth@gmail.com>2023-03-21 19:04:17 +0100
commitba30afcfec0a26ce4bcd96ea4d687c498b0ba4df (patch)
tree99a393979099895b45851e4347cbb7e72de465b5 /src/config.c
parent06b111ea849f04dca88afeee13cf5cb1b2418b57 (diff)
config: skip interface setup if interface not IFF_RUNNING
We currently setup odhcp service even if the interface is not running. This is the case for bridge or specific interface that are flagged as UP but have no carrier as nothing is connected to it. This cause a similar error like: Failed to send to ff02::1%br-lan (Address not available) This is caused by the kernel assigning IPV6 address only when the interface is set to IFF_RUNNING. A LINK-LOCAL IPV6 address is required for odhcpd_send() to work or every request will be rejected. To fix this setup services only when interface is in IFF_RUNNING state. When an interface change state, odhcpd is reloaded and the services are correctly setup again. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Acked-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c
index 9b1f659..30da879 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1303,7 +1303,7 @@ void odhcpd_reload(void)
avl_for_each_element_safe(&interfaces, i, avl, tmp) {
- if (i->inuse) {
+ if (i->inuse && i->ifflags & IFF_RUNNING) {
/* Resolve hybrid mode */
if (i->dhcpv6 == MODE_HYBRID)
i->dhcpv6 = (master && master->dhcpv6 == MODE_RELAY) ?