summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-08-20 15:34:53 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-09-06 22:50:58 +0200
commit8b895cd32faf5a48a6c565877091ff92b6541092 (patch)
tree2184249915df6da6b3365d3649a6ad68f0b0116e
parentlib: Convert libfrr.c to use new error code system (diff)
downloadfrr-8b895cd32faf5a48a6c565877091ff92b6541092.tar.xz
frr-8b895cd32faf5a48a6c565877091ff92b6541092.zip
lib: Convert netns_linux.c to new error-code work
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
-rw-r--r--lib/lib_errors.c6
-rw-r--r--lib/lib_errors.h1
-rw-r--r--lib/netns_linux.c7
3 files changed, 11 insertions, 3 deletions
diff --git a/lib/lib_errors.c b/lib/lib_errors.c
index d1c214016..5610a32cf 100644
--- a/lib/lib_errors.c
+++ b/lib/lib_errors.c
@@ -35,6 +35,12 @@ static struct log_ref ferr_lib_warn[] = {
.suggestion = "Gather log data and open an Issue, restart FRR",
},
{
+ .code = LIB_WARN_LINUX_NS,
+ .title = "The Linux namespace subsystem has encountered a parsing error",
+ .description = "During system startup an invalid parameter for the namesapce was give to FRR",
+ .suggestion = "Gather log data and open an Issue. restart FRR",
+ },
+ {
.code = END_FERR,
},
};
diff --git a/lib/lib_errors.h b/lib/lib_errors.h
index d27c1cfa2..23f5468c7 100644
--- a/lib/lib_errors.h
+++ b/lib/lib_errors.h
@@ -40,6 +40,7 @@ enum lib_log_refs {
LIB_ERR_UNAVAILABLE,
LIB_WARN_SNMP,
LIB_WARN_STREAM,
+ LIB_WARN_LINUX_NS,
};
extern void lib_error_init(void);
diff --git a/lib/netns_linux.c b/lib/netns_linux.c
index 33338ac89..e3170fee1 100644
--- a/lib/netns_linux.c
+++ b/lib/netns_linux.c
@@ -441,8 +441,8 @@ char *ns_netns_pathname(struct vty *vty, const char *name)
pathname,
safe_strerror(errno));
else
- zlog_warn("Invalid pathname for %s: %s",
- pathname,
+ flog_warn(LIB_WARN_LINUX_NS,
+ "Invalid pathname for %s: %s", pathname,
safe_strerror(errno));
return NULL;
}
@@ -452,7 +452,8 @@ char *ns_netns_pathname(struct vty *vty, const char *name)
vty_out(vty, "NS name (%s) invalid: too long (>%d)\n",
check_base, NS_NAMSIZ - 1);
else
- zlog_warn("NS name (%s) invalid: too long (>%d)",
+ flog_warn(LIB_WARN_LINUX_NS,
+ "NS name (%s) invalid: too long (>%d)",
check_base, NS_NAMSIZ - 1);
return NULL;
}