veth: delete device before creation to handle stale state
authorFelix Fietkau <[email protected]>
Mon, 20 Oct 2025 17:43:14 +0000 (19:43 +0200)
committerFelix Fietkau <[email protected]>
Mon, 20 Oct 2025 17:44:20 +0000 (19:44 +0200)
commitdf2f5c9a30f8faadf8dee962cc17d315e967d70a
tree5c4eb453886a4eb3ad7d6d31c50d7fcf66b49eb5
parent649028013a3c8f6ed53fc97ca997d2528d06b5d9
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 <[email protected]>
veth.c