]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Handle "show ospf *" even if protocol is down.
authorOndrej Filip <feela@network.cz>
Fri, 2 Jun 2000 10:21:02 +0000 (10:21 +0000)
committerOndrej Filip <feela@network.cz>
Fri, 2 Jun 2000 10:21:02 +0000 (10:21 +0000)
proto/ospf/ospf.c

index 0ab99f9b3690e4eb6faa88cd14a8a0191bf8f955..a0ec48fd5d4d6e69e7fb50b10712e763a59d9e32 100644 (file)
@@ -323,6 +323,13 @@ ospf_sh_neigh(struct proto *p, char *iff)
   struct ospf_iface *ifa=NULL,*f;
   struct ospf_neighbor *n;
   struct proto_ospf *po=(struct proto_ospf *)p;
+
+  if(p->proto_state != PS_UP)
+  {
+    cli_msg(-1013,"%s: is not up", p->name);
+    cli_msg(0,"");
+    return;
+  }
   
   if(iff!=NULL)
   {
@@ -366,6 +373,13 @@ ospf_sh(struct proto *p)
   int nno;
   int adjno;
 
+  if(p->proto_state != PS_UP)
+  {
+    cli_msg(-1014,"%s: is not up", p->name);
+    cli_msg(0,"");
+    return;
+  }
+
   cli_msg(-1014,"%s:", p->name);
   cli_msg(-1014,"Number of areas: %u", po->areano);
   
@@ -404,6 +418,13 @@ ospf_sh_iface(struct proto *p, char *iff)
   int nno;
   int adjno;
 
+  if(p->proto_state != PS_UP)
+  {
+    cli_msg(-1015,"%s: is not up", p->name);
+    cli_msg(0,"");
+    return;
+  }
+
   if(iff!=NULL)
   {
     WALK_LIST(f, po->iface_list)