nspawn: remove macvlan interfaces before network namespace died
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 30 Jul 2024 05:35:33 +0000 (14:35 +0900)
committerLuca Boccassi <bluca@debian.org>
Thu, 15 Aug 2024 12:08:37 +0000 (13:08 +0100)
commit233ae5056f184461393a598185a5af61cd410ca8
tree46434b0b4e98818deec95938f4881e9697663840
parent3d90344e941f10b6fe7b1a315b79ca09c4451a86
nspawn: remove macvlan interfaces before network namespace died

This is similar to what we do for veth interfaces in remove_veth_links().

When a container rebooted, macvlan interfaces created by the previous
boot may still exist in the kernel, and that causes -EADDRINUSE after
reboot.

Hopefully fixes #680.

(cherry picked from commit 1bfa47418e9df03c2562a4c82dc319cf7c3b228c)
src/nspawn/nspawn-network.c
src/nspawn/nspawn-network.h
src/nspawn/nspawn.c