From f0098059a7caf7ade6f27b054e7abddb2b3d2bb9 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Wed, 5 Jun 2024 13:16:20 +0200 Subject: [PATCH] confd: interfaces: Flush addresses when exiting current generation The interface in question might not exist at init:49 if some other change requires it to be recreated from scratch, in which case it will be removed in exit:50. Therefore, run the flush at exit:49, where it should always still exist. --- src/confd/src/ietf-interfaces.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/confd/src/ietf-interfaces.c b/src/confd/src/ietf-interfaces.c index 8a5f8452..f069e8ef 100644 --- a/src/confd/src/ietf-interfaces.c +++ b/src/confd/src/ietf-interfaces.c @@ -480,7 +480,7 @@ static int netdag_gen_ip_addrs(struct dagger *net, FILE *ip, const char *proto, if (!cni_find(ifname) && if_nametoindex(ifname)) { FILE *fp; - fp = dagger_fopen_next(net, "init", ifname, 49, "flush.sh"); + fp = dagger_fopen_current(net, "exit", ifname, 49, "flush.sh"); if (fp) { fprintf(fp, "ip -%c addr flush dev %s\n", proto[3], ifname); fclose(fp);