summaryrefslogtreecommitdiffstats
path: root/lib/ferr.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-06-14 13:57:39 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-08-14 22:02:05 +0200
commit9023454067e0d18fd6a8d108e990841ed913cfcd (patch)
tree884768db18b61dff153880adfd064af95516e809 /lib/ferr.c
parentlib: add error reference system (diff)
downloadfrr-9023454067e0d18fd6a8d108e990841ed913cfcd.tar.xz
frr-9023454067e0d18fd6a8d108e990841ed913cfcd.zip
lib: Allow adding arrays of ferr's
Simplify addition of new messages to the system by allow passage of arrays of data, instead of one at a time. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/ferr.c')
-rw-r--r--lib/ferr.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/ferr.c b/lib/ferr.c
index ccf2f853e..6625749c3 100644
--- a/lib/ferr.c
+++ b/lib/ferr.c
@@ -74,9 +74,14 @@ static inline unsigned int ferr_hash_key(void *a)
void ferr_ref_add(struct ferr_ref *ref)
{
+ uint32_t i = 0;
+
pthread_mutex_lock(&refs_mtx);
{
- hash_get(refs, ref, hash_alloc_intern);
+ while (ref[i].code != END_FERR) {
+ hash_get(refs, &ref[i], hash_alloc_intern);
+ i++;
+ }
}
pthread_mutex_unlock(&refs_mtx);
}