]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
OSPF: Fix 'show ospf lsadb' cmd without proto arg
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Thu, 29 Aug 2019 18:58:16 +0000 (20:58 +0200)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Thu, 29 Aug 2019 18:58:16 +0000 (20:58 +0200)
It crashed when used without protocol argument.

Thanks to Alexander for the bugreport.

proto/ospf/config.Y

index 2ec8c0b6222cf441c9ad3612737e81875f9f51e7..f631a64934562c6722684efa85d3c7668322bafd 100644 (file)
@@ -537,7 +537,12 @@ CF_CLI(SHOW OSPF STATE ALL, optproto opttext, [<name>], [[Show information about
 
 CF_CLI_HELP(SHOW OSPF LSADB, ..., [[Show content of OSPF LSA database]]);
 CF_CLI(SHOW OSPF LSADB, lsadb_args, [global | area <id> | link] [type <num>] [lsid <id>] [self | router <id>] [<proto>], [[Show content of OSPF LSA database]])
-{ ospf_sh_lsadb($4); };
+{
+  if (!$4->proto)
+    $4->proto = (struct ospf_proto *) proto_get_named(NULL, &proto_ospf);
+
+  ospf_sh_lsadb($4);
+};
 
 lsadb_args:
    /* empty */ {