From 532910db879d6e882cf67a780ce1aa037a95ec64 Mon Sep 17 00:00:00 2001 From: kn Date: Sat, 20 Nov 2021 11:47:02 +0000 Subject: [PATCH] Start on DOWN interfaces Do not skip interfaces during startup because they're not UP. dhcpd(8) can start listening on such interfaces just fine (given suitable IPs on them) and interfaces may come UP later in time. Otherwise dhcpd would fail to start completely if it didn't find any interface that would be UP early on and administrators had to restart dhcpd. Other daemons and nc(1)'s `-l' listen just fine on DOWN interfaces as well. Noticed while switching a bridge(4)/vether(4) setup to veb(4)/vport(4) and hostname.vport without explicit "up" (vport does not implicitly pulls itself UP when configuring an address). OK dlg florian --- usr.sbin/dhcpd/dispatch.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/usr.sbin/dhcpd/dispatch.c b/usr.sbin/dhcpd/dispatch.c index 7c456512940..8b8972be996 100644 --- a/usr.sbin/dhcpd/dispatch.c +++ b/usr.sbin/dhcpd/dispatch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dispatch.c,v 1.43 2017/04/12 19:17:30 krw Exp $ */ +/* $OpenBSD: dispatch.c,v 1.44 2021/11/20 11:47:02 kn Exp $ */ /* * Copyright (c) 1995, 1996, 1997, 1998, 1999 @@ -112,13 +112,12 @@ discover_interfaces(int *rdomain) for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) { /* * See if this is the sort of interface we want to - * deal with. Skip loopback, point-to-point and down + * deal with. Skip loopback and point-to-point * interfaces, except don't skip down interfaces if we're * trying to get a list of configurable interfaces. */ if ((ifa->ifa_flags & IFF_LOOPBACK) || (ifa->ifa_flags & IFF_POINTOPOINT) || - (!(ifa->ifa_flags & IFF_UP)) || (!(ifa->ifa_flags & IFF_BROADCAST))) continue; -- 2.20.1