summaryrefslogtreecommitdiffstats
path: root/ospf6d/ospf6_lsdb.c
diff options
context:
space:
mode:
authorPaul Jakma <paul@opensourcerouting.org>2014-09-19 16:35:15 +0200
committerDaniel Walton <dwalton@cumulusnetworks.com>2016-05-26 03:08:36 +0200
commitf58c5fbdc316d8b2f2ebff06667a30645f1d31b5 (patch)
tree5983090d735ed67e19aededddd4268c5aa7f601a /ospf6d/ospf6_lsdb.c
parentAdd missing GPL headers, and copyright claims that certainly apply. (diff)
downloadfrr-f58c5fbdc316d8b2f2ebff06667a30645f1d31b5.tar.xz
frr-f58c5fbdc316d8b2f2ebff06667a30645f1d31b5.zip
ospf6_lsdb: trivial, make it clear that showfunc is set before deref.
(cherry picked from commit 7bef33cbf5027189bd55e4890a07a6bef8277f93)
Diffstat (limited to 'ospf6d/ospf6_lsdb.c')
-rw-r--r--ospf6d/ospf6_lsdb.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/ospf6d/ospf6_lsdb.c b/ospf6d/ospf6_lsdb.c
index c73d6923f..04bea84ae 100644
--- a/ospf6d/ospf6_lsdb.c
+++ b/ospf6d/ospf6_lsdb.c
@@ -487,22 +487,29 @@ ospf6_lsdb_maxage_remover (struct ospf6_lsdb *lsdb)
}
void
-ospf6_lsdb_show (struct vty *vty, int level,
+ospf6_lsdb_show (struct vty *vty, enum ospf_lsdb_show_level level,
u_int16_t *type, u_int32_t *id, u_int32_t *adv_router,
struct ospf6_lsdb *lsdb)
{
struct ospf6_lsa *lsa;
void (*showfunc) (struct vty *, struct ospf6_lsa *) = NULL;
- if (level == OSPF6_LSDB_SHOW_LEVEL_NORMAL)
- showfunc = ospf6_lsa_show_summary;
- else if (level == OSPF6_LSDB_SHOW_LEVEL_DETAIL)
- showfunc = ospf6_lsa_show;
- else if (level == OSPF6_LSDB_SHOW_LEVEL_INTERNAL)
- showfunc = ospf6_lsa_show_internal;
- else if (level == OSPF6_LSDB_SHOW_LEVEL_DUMP)
- showfunc = ospf6_lsa_show_dump;
-
+ switch (level)
+ {
+ case OSPF6_LSDB_SHOW_LEVEL_DETAIL:
+ showfunc = ospf6_lsa_show;
+ break;
+ case OSPF6_LSDB_SHOW_LEVEL_INTERNAL:
+ showfunc = ospf6_lsa_show_internal;
+ break;
+ case OSPF6_LSDB_SHOW_LEVEL_DUMP:
+ showfunc = ospf6_lsa_show_dump;
+ break;
+ case OSPF6_LSDB_SHOW_LEVEL_NORMAL:
+ default:
+ showfunc = ospf6_lsa_show_summary;
+ }
+
if (type && id && adv_router)
{
lsa = ospf6_lsdb_lookup (*type, *id, *adv_router, lsdb);