mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-31 21:13:00 +02:00
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:
committed by
Tobias Waldekranz
parent
5e5cc8070f
commit
76b7dce7fc
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user