]> git.puffer.fish Git - mirror/frr.git/commitdiff
2005-09-05 Paul Jakma <paul.jakma@sun.com>
authorpaul <paul>
Mon, 5 Sep 2005 11:54:13 +0000 (11:54 +0000)
committerpaul <paul>
Mon, 5 Sep 2005 11:54:13 +0000 (11:54 +0000)
* command.c: (install_element) be more robust. Eg, cmd_init
  need not have been called, some applications may use other
  library subsystems, which call install_element, without the
          application wanting commands and hence not calling cmd_init.

lib/ChangeLog
lib/command.c

index fd6e20b616ac64ce55c42ce016b2a1477d489b8b..08d6278f65c0be38ad4435289910dcd30c2ee21a 100644 (file)
@@ -1,3 +1,10 @@
+2005-09-05 Paul Jakma <paul.jakma@sun.com>
+
+       * command.c: (install_element) be more robust. Eg, cmd_init
+         need not have been called, some applications may use other
+         library subsystems, which call install_element, without the
+          application wanting commands and hence not calling cmd_init.
+        
 2005-08-22 Hugo Santos <hsantos@av.it.pt>
 
        * command.h: (enum node_type) Add BGP_IPV6M_NODE 
index f64235954cb6929c9c133561c26a5a7dcd7301c6..2b7ca9ad34f9bd9977e12fd140fd6977c3fcb1ea 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   $Id: command.c,v 1.49 2005/08/22 22:39:56 paul Exp $
+   $Id: command.c,v 1.50 2005/09/05 11:54:13 paul Exp $
  
    Command interpreter routine for virtual terminal [aka TeletYpe]
    Copyright (C) 1997, 98, 99 Kunihiro Ishiguro
@@ -35,7 +35,7 @@ Boston, MA 02111-1307, USA.  */
 
 /* Command vector which includes some level of command lists. Normally
    each daemon maintains each own cmdvec. */
-vector cmdvec;
+vector cmdvec = NULL;
 
 /* Host information structure. */
 struct host host;
@@ -475,7 +475,11 @@ void
 install_element (enum node_type ntype, struct cmd_element *cmd)
 {
   struct cmd_node *cnode;
-
+  
+  /* cmd_init hasn't been called */
+  if (!cmdvec)
+    return;
+  
   cnode = vector_slot (cmdvec, ntype);
 
   if (cnode == NULL)