confd: ignore other end of veth pairs also when deleting interfaces

Same as with creating veth pairs, we must not try to delete both ends
since the kernel does that for us.  Ensure we check skip in the current
generation and not in the next.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2023-06-22 00:12:43 +02:00
committed by Tobias Waldekranz
parent 5e5cc8070f
commit 76b7dce7fc
3 changed files with 9 additions and 0 deletions
+5
View File
@@ -120,6 +120,11 @@ int dagger_should_skip(struct dagger *d, const char *ifname)
return fexistf("%s/%d/skip/%s", d->path, d->next, ifname);
}
int dagger_should_skip_current(struct dagger *d, const char *ifname)
{
return fexistf("%s/%d/skip/%s", d->path, d->current, ifname);
}
int dagger_claim(struct dagger *d, const char *path)
{
+1
View File
@@ -24,6 +24,7 @@ int dagger_evolve_or_abandon(struct dagger *d);
void dagger_skip_iface(struct dagger *d, const char *ifname);
int dagger_should_skip(struct dagger *d, const char *ifname);
int dagger_should_skip_current(struct dagger *d, const char *ifname);
int dagger_claim(struct dagger *d, const char *path);
+3
View File
@@ -805,6 +805,9 @@ static int netdag_gen_iface_del(struct dagger *net, struct lyd_node *dif,
DEBUG_IFACE(dif, "");
if (dagger_should_skip_current(net, ifname))
return 0;
ip = dagger_fopen_current(net, "exit", ifname, 50, "exit.ip");
if (!ip)
return -EIO;