summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-06-18 14:49:36 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-08-14 22:02:05 +0200
commit4d43f68aeb2d26d7ea5e69a97970c4a4545882c5 (patch)
treecc713f5f29402d72a1d49e0a6ae9b2ced4ee9374 /lib
parentbgpd, lib, zebra: Convert LIB_ERR_PRIVILEGES (diff)
downloadfrr-4d43f68aeb2d26d7ea5e69a97970c4a4545882c5.tar.xz
frr-4d43f68aeb2d26d7ea5e69a97970c4a4545882c5.zip
lib, zebra: Add LIB_ERR_INTERFACE
Add a error type that allows us to track bad interface states. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/if.c1
-rw-r--r--lib/if.h12
-rw-r--r--lib/lib_errors.c6
-rw-r--r--lib/lib_errors.h1
4 files changed, 16 insertions, 4 deletions
diff --git a/lib/if.c b/lib/if.c
index dd7d21038..6023624dc 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -23,6 +23,7 @@
#include "linklist.h"
#include "vector.h"
+#include "lib_errors.h"
#include "vty.h"
#include "command.h"
#include "vrf.h"
diff --git a/lib/if.h b/lib/if.h
index 7b65bbd2e..4379e1ad8 100644
--- a/lib/if.h
+++ b/lib/if.h
@@ -297,28 +297,32 @@ DECLARE_QOBJ_TYPE(interface)
#define IFNAME_RB_INSERT(vrf, ifp) \
if (RB_INSERT(if_name_head, &vrf->ifaces_by_name, (ifp))) \
- zlog_err( \
+ zlog_ferr( \
+ LIB_ERR_INTERFACE, \
"%s(%s): corruption detected -- interface with this " \
"name exists already in VRF %u!", \
__func__, (ifp)->name, (ifp)->vrf_id);
#define IFNAME_RB_REMOVE(vrf, ifp) \
if (RB_REMOVE(if_name_head, &vrf->ifaces_by_name, (ifp)) == NULL) \
- zlog_err( \
+ zlog_ferr( \
+ LIB_ERR_INTERFACE, \
"%s(%s): corruption detected -- interface with this " \
"name doesn't exist in VRF %u!", \
__func__, (ifp)->name, (ifp)->vrf_id);
#define IFINDEX_RB_INSERT(vrf, ifp) \
if (RB_INSERT(if_index_head, &vrf->ifaces_by_index, (ifp))) \
- zlog_err( \
+ zlog_ferr( \
+ LIB_ERR_INTERFACE, \
"%s(%u): corruption detected -- interface with this " \
"ifindex exists already in VRF %u!", \
__func__, (ifp)->ifindex, (ifp)->vrf_id);
#define IFINDEX_RB_REMOVE(vrf, ifp) \
if (RB_REMOVE(if_index_head, &vrf->ifaces_by_index, (ifp)) == NULL) \
- zlog_err( \
+ zlog_ferr( \
+ LIB_ERR_INTERFACE, \
"%s(%u): corruption detected -- interface with this " \
"ifindex doesn't exist in VRF %u!", \
__func__, (ifp)->ifindex, (ifp)->vrf_id);
diff --git a/lib/lib_errors.c b/lib/lib_errors.c
index 44d9ecd03..d1db7b777 100644
--- a/lib/lib_errors.c
+++ b/lib/lib_errors.c
@@ -77,6 +77,12 @@ static struct ferr_ref ferr_lib_err[] = {
.suggestion = "Examine callback message and ensure snmp is properly setup and working"
},
{
+ .code = LIB_ERR_INTERFACE,
+ .title = "Interface Subsystem Error",
+ .description = "FRR has detected a problem with interface data from the kernel as it deviates\nfrom what we would expect to happen via normal netlink messaging",
+ .suggestion = "Open an Issue with all relevant log files and restart FRR"
+ },
+ {
.code = END_FERR,
}
};
diff --git a/lib/lib_errors.h b/lib/lib_errors.h
index 671c768eb..67feb6882 100644
--- a/lib/lib_errors.h
+++ b/lib/lib_errors.h
@@ -33,6 +33,7 @@ enum lib_ferr_refs {
LIB_ERR_SYSTEM_CALL,
LIB_ERR_VTY,
LIB_ERR_SNMP,
+ LIB_ERR_INTERFACE,
};
extern void lib_error_init(void);