]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Remove old code to destroy the network
authorDaniel Lezcano <dlezcano@fr.ibm.com>
Thu, 28 May 2009 10:10:50 +0000 (12:10 +0200)
committerDaniel Lezcano <dlezcano@fr.ibm.com>
Thu, 28 May 2009 10:10:50 +0000 (12:10 +0200)
Removed this unused code.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
configure.ac
src/lxc/conf.c

index bc27fd88eb74cb7d7951b5e5304d6360cb6429ce..6e28345026825bfa55e96425ee1df91b4de3d236 100644 (file)
@@ -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)
 
index 7fb67bb3aabe2c761a3bc5be20606a03c0c56e72..a19e25e4d1af95f952fc71b938ae14cdb6cb4019 100644 (file)
@@ -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];