From ae5338bde5d9395f778217fbe240403f3735fd75 Mon Sep 17 00:00:00 2001 From: Gao feng Date: Fri, 23 Oct 2015 21:36:53 +0800 Subject: [PATCH] do not remove lo device in cleanup net Signed-off-by: Gao feng --- src/net.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/net.c b/src/net.c index bd4a58a..822d18b 100644 --- a/src/net.c +++ b/src/net.c @@ -707,6 +707,11 @@ static int hyper_cleanup_interface(struct rtnl_handle *rth, return -1; } + /* Don't down&remove lo device */ + if (strcmp(iface->device, "lo") == 0) { + return 0; + } + if (hyper_down_nic(rth, iface->ifindex) < 0) { fprintf(stderr, "up device %d failed\n", iface->ifindex); return -1;