From 34c66a6980bebf1ca9b7da87e627fc507a6c139a Mon Sep 17 00:00:00 2001 From: Daniel Lezcano Date: Thu, 28 May 2009 12:10:50 +0200 Subject: [PATCH] Remove old code to destroy the network Removed this unused code. Signed-off-by: Daniel Lezcano --- configure.ac | 8 ------- src/lxc/conf.c | 58 -------------------------------------------------- 2 files changed, 66 deletions(-) diff --git a/configure.ac b/configure.ac index bc27fd88e..6e2834502 100644 --- a/configure.ac +++ b/configure.ac @@ -50,14 +50,6 @@ AC_ARG_WITH([kernel-release], [KERNEL_RELEASE="${withval}"], [KERNEL_RELEASE=`uname -r`]) -AX_COMPARE_VERSION([$KERNEL_RELEASE], [ge], [2.6.29], - AC_MSG_NOTICE([network autodestroy: yes]), - AC_MSG_NOTICE([network autodestroy: no])) - -if test ${ax_compare_version} != "true"; then - CFLAGS="$CFLAGS -DNETWORK_DESTROY" -fi - AC_ARG_ENABLE(test, [ --enable-test compile test program [default=no]],, enable_test=no) AM_CONDITIONAL(ENABLE_TEST, test x$enable_test = xyes) diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 7fb67bb3a..a19e25e4d 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -1679,64 +1679,6 @@ int conf_create_network(const char *name, pid_t pid) return 0; } -#ifdef NETWORK_DESTROY -static int delete_netdev_cb(const char *name, const char *directory, - const char *file, void *data) -{ - char strindex[MAXINDEXLEN]; - char path[MAXPATHLEN]; - char ifname[IFNAMSIZ]; - int i, ifindex; - - snprintf(path, MAXPATHLEN, "%s/%s", directory, file); - - if (read_info(path, "ifindex", strindex, MAXINDEXLEN)) { - ERROR("failed to read ifindex info"); - return -1; - } - - ifindex = atoi(strindex); - if (!ifindex) - return 0; - - /* TODO : temporary code - needs wait on namespace */ - for (i = 0; i < 120; i++) { - if (if_indextoname(ifindex, ifname)) - break; - if (!i) - printf("waiting for interface #%d to come back\n", ifindex); - else - printf("."); fflush(stdout); - sleep(1); - } - - /* do not delete a physical network device */ - if (strncmp("phys", file, strlen("phys"))) - if (lxc_device_delete(ifname)) { - ERROR("failed to remove the netdev %s", ifname); - } - - delete_info(path, "ifindex"); - - return 0; -} -#endif - -int conf_destroy_network(const char *name) -{ -#ifdef NETWORK_DESTROY - char directory[MAXPATHLEN]; - - snprintf(directory, MAXPATHLEN, LXCPATH "/%s/network", name); - - if (lxc_dir_for_each(name, directory, delete_netdev_cb, NULL)) { - ERROR("failed to remove the network devices"); - return -1; - } -#endif - return 0; -} - int lxc_create_tty(const char *name, struct lxc_tty_info *tty_info) { char path[MAXPATHLEN];