From eb89f14ea36e92e9e34e50f6f3f3003a64fe4d5d Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Tue, 12 Dec 2023 15:25:29 +0100 Subject: [PATCH] confd: add netlink condition to dhcp-client, This patch ensures that the DHCP client is not started until the interface is up and running (link). If the interface goes down, or loses link, the client is stopped and everything learned from the server (address, routes, DNS/NTP servers, etc.) is remvoed. Signed-off-by: Joachim Wiberg --- src/confd/src/infix-dhcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/confd/src/infix-dhcp.c b/src/confd/src/infix-dhcp.c index 22598916..49f42bcd 100644 --- a/src/confd/src/infix-dhcp.c +++ b/src/confd/src/infix-dhcp.c @@ -244,12 +244,12 @@ static void add(const char *ifname, struct lyd_node *cfg) fprintf(fp, "# Generated by Infix confd\n"); fprintf(fp, "metric=%s\n", metric); - fprintf(fp, "service name:dhcp :%s \\\n" + fprintf(fp, "service name:dhcp :%s \\\n" " [2345] udhcpc -f -p /run/dhcp-%s.pid -t 10 -T 3 -A 10 %s -S -R \\\n" " -o %s \\\n" " -i %s %s %s %s \\\n" " -- DHCP client @%s\n", - ifname, ifname, do_arp, + ifname, ifname, ifname, do_arp, options, ifname, args ?: "", ipcache ?: "", vendor, ifname); fclose(fp);