vzctl set --ipdel all: fix removing IPs from CT
This is a bit tricky. vps_net_ctl() is called twice -- for ADD
and for DEL operations, with different resources ('net' and 'del_net').
The problem is delall flag is only set in 'net' but not in 'del_net'.
When vps_net_ctl() is called for DEL it checks that the list of IPs
is empty and 'delall' is not set (because it is not set in del_net)
so it exits immediately, therefore vps_ip_configure(op=DEL) is not
called.
By setting the delall=YES flag in del_net we make vps_ip_configure()
to be called and call del_ip distro-specific script which takes care
of removing all the IPs.
The bug exists in vzctl for quite a long time (at least since
vzctl-3.0.23), but is relatively harmless because IP routing and ARP
was deleted from the host system, so the only thing left was an IP
inside CT, which doesn't work w/o routing and ARP on the host.
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
1 file changed