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 <luca.boccassi@gmail.com>
Tue, 30 Jul 2024 10:38:50 +0000 (12:38 +0200)
commit1bfa47418e9df03c2562a4c82dc319cf7c3b228c
tree5fc8e8bad634fbe3338cf50f835ec97e5883a63c
parentb56920e36c5692c0dde701bfb48330653a9c62c9
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.
src/nspawn/nspawn-network.c
src/nspawn/nspawn-network.h
src/nspawn/nspawn.c