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.
This commit is contained in:
Tobias Waldekranz
2024-06-07 10:10:38 +02:00
parent de6c624b95
commit f0098059a7
+1 -1
View File
@@ -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);