diff options
| author | Felix Fietkau | 2025-10-20 17:43:14 +0000 |
|---|---|---|
| committer | Felix Fietkau | 2025-10-20 17:44:20 +0000 |
| commit | df2f5c9a30f8faadf8dee962cc17d315e967d70a (patch) | |
| tree | 5c4eb453886a4eb3ad7d6d31c50d7fcf66b49eb5 | |
| parent | 649028013a3c8f6ed53fc97ca997d2528d06b5d9 (diff) | |
| download | netifd-df2f5c9a30f8faadf8dee962cc17d315e967d70a.tar.gz | |
veth: delete device before creation to handle stale state
When a veth device already exists in the kernel (from a previous failed
cleanup or external creation), attempting to create it again with
NLM_F_EXCL fails with -EEXIST. This leaves the device in a broken state
where netifd marks it as present but cannot bring it up.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
| -rw-r--r-- | veth.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -68,6 +68,8 @@ veth_set_up(struct veth *veth) { int ret; + system_veth_del(&veth->dev); + ret = system_veth_add(&veth->dev, &veth->config); if (ret < 0) return ret; |