]> git.puffer.fish Git - matthieu/frr.git/commitdiff
From: Hasso Tepper <hasso@estpak.ee>
authorpaul <paul>
Sat, 24 May 2003 06:40:04 +0000 (06:40 +0000)
committerpaul <paul>
Sat, 24 May 2003 06:40:04 +0000 (06:40 +0000)
ensure only interfaces that are inactive or do not exist can be deleted

lib/if.c
zebra/interface.c

index 2ca8c94bb0d3e59e54de95d7d8218bd46f2e309b..f003754ad0368e9b4922fb68df4ab7b7d705af91 100644 (file)
--- a/lib/if.c
+++ b/lib/if.c
@@ -453,9 +453,13 @@ DEFUN_NOSH (no_interface,
   ifp = if_lookup_by_name (argv[0]);
 
   if (ifp == NULL)
-    return CMD_SUCCESS;
+  {
+    vty_out (vty, "%% Inteface %s does not exist%s", argv[0], VTY_NEWLINE);
+    return CMD_WARNING;
+  }
 
-  if (if_is_up(ifp)) {
+  if (CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE)) 
+  {
     vty_out (vty, "%% Only inactive interfaces can be deleted%s",
             VTY_NEWLINE);
     return CMD_WARNING;
index c9f713208b9fa08b5c2a84f525c7ac4008adcbb9..f2374316c63f5c5d3f16866f49457adba364b701 100644 (file)
@@ -674,36 +674,6 @@ DEFUN_NOSH (zebra_interface,
   return ret;
 }
 
-DEFUN_NOSH (no_zebra_interface,
-       no_zebra_interface_cmd,
-       "no interface IFNAME",
-       "Delete a pseudo interface's configuration\n"
-       "Interface's name\n")
-{
-  struct interface *ifp;
-  
-  ifp = if_lookup_by_name(argv[0]);
-  
-  if (ifp == NULL) 
-    {
-      vty_out (vty, "Inteface %s does not exist%s", 
-              argv[0],
-              VTY_NEWLINE);
-      return CMD_WARNING;
-    }
-
-  if (CHECK_FLAG (ifp->status, ZEBRA_INTERFACE_ACTIVE))
-    {
-      vty_out(vty, "%% Only inactive interfaces can be deleted%s", VTY_NEWLINE);
-      return CMD_WARNING;
-    }
-
-  /* Delete interface */
-  if_delete(ifp);
-
-  return CMD_SUCCESS;
-} 
-
 struct cmd_node interface_node =
 {
   INTERFACE_NODE,
@@ -1431,7 +1401,7 @@ zebra_if_init ()
   install_element (VIEW_NODE, &show_interface_cmd);
   install_element (ENABLE_NODE, &show_interface_cmd);
   install_element (CONFIG_NODE, &zebra_interface_cmd);
-  install_element (CONFIG_NODE, &no_zebra_interface_cmd);
+  install_element (CONFIG_NODE, &no_interface_cmd);
   install_default (INTERFACE_NODE);
   install_element (INTERFACE_NODE, &interface_desc_cmd);
   install_element (INTERFACE_NODE, &no_interface_desc_cmd);