]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: Convert netns_linux.c to new error-code work
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 20 Aug 2018 13:34:53 +0000 (09:34 -0400)
committerQuentin Young <qlyoung@cumulusnetworks.com>
Thu, 6 Sep 2018 20:50:58 +0000 (20:50 +0000)
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/lib_errors.c
lib/lib_errors.h
lib/netns_linux.c

index d1c2140160ca46f629c2c738d4011efad865f67d..5610a32cf14b6d15589c712f2f3a237f2d5f73da 100644 (file)
@@ -34,6 +34,12 @@ static struct log_ref ferr_lib_warn[] = {
                .description = "During sanity checking stream.c has detected an error in the data associated with a particular stream",
                .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,
        },
index d27c1cfa26181fbe37d4c6a1d228e242df410b32..23f5468c7792e90e625e5d78eeabfb6b59d65795 100644 (file)
@@ -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);
index 33338ac89c2c21213ebbe53f12fc513bde5fd90d..e3170fee1ef43a8b53b42e8cdd45541b4839088f 100644 (file)
@@ -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;
        }