summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
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 dd7d210381..6023624dc1 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 7b65bbd2e5..4379e1ad8c 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 44d9ecd033..d1db7b777a 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 671c768eb9..67feb68827 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);