X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=util-vserver%2Fvserver-start%2Finterface.c;fp=util-vserver%2Fvserver-start%2Finterface.c;h=d6fd9f1cf31a912a044772dee422ab0e3d37c9ae;hb=459ba6df2aeae93944f901a2ff2181289cc8db99;hp=6afbbe4826cced72b6147adaea6669e1aa7e2be4;hpb=96551a8b8a39daa5465c17efd1af422bf2bf56c9;p=util-vserver.git diff --git a/util-vserver/vserver-start/interface.c b/util-vserver/vserver-start/interface.c index 6afbbe4..d6fd9f1 100644 --- a/util-vserver/vserver-start/interface.c +++ b/util-vserver/vserver-start/interface.c @@ -24,9 +24,16 @@ #include "vserver-start.h" #include "configuration.h" +#include "undo.h" #include +static void +Iface_removeWrapper(void const *iface) +{ + (void)Iface_remove(iface); +} + void activateInterfaces() { @@ -34,6 +41,14 @@ activateInterfaces() for (iface=Vector_begin(&cfg.interfaces); iface!=Vector_end(&cfg.interfaces); - ++iface) - Iface_add(iface); + ++iface) { + if (!Iface_add(iface)) { + WRITE_MSG(2, "Failed to add interface "); + Iface_print(iface, 2); + WRITE_MSG(2, "\n"); + + exit(1); + } + Undo_addTask(Iface_removeWrapper, iface); + } }