while (written > 0) {
struct buffer_data *d;
if (!(d = b->head)) {
- zlog_err(
- "%s: corruption detected: buffer queue empty, "
- "but written is %lu",
+ zlog_ferr(
+ LIB_ERR_DEVELOPMENT,
+ "%s: corruption detected: buffer queue empty, but written is %lu",
__func__, (unsigned long)written);
break;
}
.description = "FRR has detected a problem with NameSpace data from the kernel as it deviates\nfrom what we would expect to happen via normal kernel messaging",
.suggestion = "Open an Issue with all relevant log files and restart FRR"
},
+ {
+ .code = LIB_ERR_DEVELOPMENT,
+ .title = "Developmental Escape Error",
+ .description = "FRR has detected an issue where new development has not properly\nupdated all code paths.",
+ .suggestion = "Open an Issue with all relevant log files"
+ },
{
.code = END_FERR,
}
#define __LIB_ERRORS_H__
#include "ferr.h"
-#include "lib_errors.h"
enum lib_ferr_refs {
LIB_ERR_PRIVILEGES = LIB_FERR_START,
LIB_ERR_SNMP,
LIB_ERR_INTERFACE,
LIB_ERR_NS,
+ LIB_ERR_DEVELOPMENT,
};
extern void lib_error_init(void);
unsigned int i;
if (zroute >= array_size(route_types)) {
- zlog_err("unknown zebra route type: %u", zroute);
+ zlog_ferr(LIB_ERR_DEVELOPMENT, "unknown zebra route type: %u",
+ zroute);
return &unknown;
}
if (zroute == route_types[zroute].type)
return &route_types[i];
}
}
- zlog_err("internal error: cannot find route type %u in table!", zroute);
+ zlog_ferr(LIB_ERR_DEVELOPMENT,
+ "internal error: cannot find route type %u in table!",
+ zroute);
return &unknown;
}
const char *zserv_command_string(unsigned int command)
{
if (command >= array_size(command_types)) {
- zlog_err("unknown zserv command type: %u", command);
+ zlog_ferr(LIB_ERR_DEVELOPMENT, "unknown zserv command type: %u",
+ command);
return unknown.string;
}
return command_types[command].string;
#include "memory.h"
#include "log.h"
#include "jhash.h"
+#include "lib_errors.h"
DEFINE_MTYPE_STATIC(LIB, PREFIX, "Prefix")
memcpy((void *)dest->u.prefix_flowspec.ptr,
(void *)src->u.prefix_flowspec.ptr, len);
} else {
- zlog_err("prefix_copy(): Unknown address family %d",
- src->family);
+ zlog_ferr(LIB_ERR_DEVELOPMENT,
+ "prefix_copy(): Unknown address family %d",
+ src->family);
assert(0);
}
}
#include "log.h"
#include "vty.h"
#include "skiplist.h"
+#include "lib_errors.h"
DEFINE_MTYPE_STATIC(LIB, SKIP_LIST, "Skip List")
DEFINE_MTYPE_STATIC(LIB, SKIP_LIST_NODE, "Skip Node")
/* DEBUG */
if (!key) {
- zlog_err("%s: key is 0, value is %p", __func__, value);
+ zlog_ferr(LIB_ERR_DEVELOPMENT, "%s: key is 0, value is %p",
+ __func__, value);
}
p = l->header;
TELNET_NAWS_SB_LEN,
(unsigned long)vty->sb_len);
else if (sizeof(vty->sb_buf) < TELNET_NAWS_SB_LEN)
- zlog_err(
- "Bug detected: sizeof(vty->sb_buf) %lu < %d, "
- "too small to handle the telnet NAWS option",
+ zlog_ferr(
+ LIB_ERR_DEVELOPMENT,
+ "Bug detected: sizeof(vty->sb_buf) %lu < %d, too small to handle the telnet NAWS option",
(unsigned long)sizeof(vty->sb_buf),
TELNET_NAWS_SB_LEN);
else {