summaryrefslogtreecommitdiff
path: root/ospfd/ospf_gr_helper.h
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2020-10-14 12:51:52 -0400
committerMark Stapp <mjs@voltanet.io>2020-10-14 12:51:52 -0400
commitd05d5280e6472a6bc2c8aa8bfcae4f3fca0894da (patch)
tree3a561fb79f40565eb722ea3c6fe46f8647d96376 /ospfd/ospf_gr_helper.h
parent6431621e4eb11c4b85d6c29f79d060d59b0ed5d2 (diff)
ospfd: make reason string production safer
Use to-string functions for GR message codes instead of raw string array indexing; the values used can come in packets and are not validated. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'ospfd/ospf_gr_helper.h')
-rw-r--r--ospfd/ospf_gr_helper.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/ospfd/ospf_gr_helper.h b/ospfd/ospf_gr_helper.h
index 4e83028fe6..c355bb4f3d 100644
--- a/ospfd/ospf_gr_helper.h
+++ b/ospfd/ospf_gr_helper.h
@@ -152,9 +152,9 @@ struct advRtr {
#define OSPF_GR_FAILURE 0
#define OSPF_GR_INVALID -1
-extern const char *ospf_exit_reason_desc[];
-extern const char *ospf_restart_reason_desc[];
-extern const char *ospf_rejected_reason_desc[];
+const char *ospf_exit_reason2str(unsigned int reason);
+const char *ospf_restart_reason2str(unsigned int reason);
+const char *ospf_rejected_reason2str(unsigned int reason);
extern void ospf_gr_helper_init(struct ospf *ospf);
extern void ospf_gr_helper_stop(struct ospf *ospf);