]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Convert bgp_dump.c to use flog_warn
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 15 Aug 2018 19:19:21 +0000 (15:19 -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>
bgpd/bgp_dump.c
bgpd/bgp_errors.c
bgpd/bgp_errors.h

index d69b1c46f268ec5531d67391e86703a4d78a14ca..49f27d298b0182c8cf218433c1a83e66e1c686f1 100644 (file)
@@ -36,6 +36,7 @@
 #include "bgpd/bgp_route.h"
 #include "bgpd/bgp_attr.h"
 #include "bgpd/bgp_dump.h"
+#include "bgpd/bgp_errors.h"
 
 enum bgp_dump_type {
        BGP_DUMP_ALL,
@@ -119,7 +120,7 @@ static FILE *bgp_dump_open_file(struct bgp_dump *bgp_dump)
                ret = strftime(realpath, MAXPATHLEN, bgp_dump->filename, tm);
 
        if (ret == 0) {
-               zlog_warn("bgp_dump_open_file: strftime error");
+               flog_warn(BGP_WARN_DUMP, "bgp_dump_open_file: strftime error");
                return NULL;
        }
 
@@ -131,7 +132,7 @@ static FILE *bgp_dump_open_file(struct bgp_dump *bgp_dump)
        bgp_dump->fp = fopen(realpath, "w");
 
        if (bgp_dump->fp == NULL) {
-               zlog_warn("bgp_dump_open_file: %s: %s", realpath,
+               flog_warn(BGP_WARN_DUMP, "bgp_dump_open_file: %s: %s", realpath,
                          strerror(errno));
                umask(oldumask);
                return NULL;
index 5b0c4b0da55b6cfff92ca70b8ccabdfbd1b4d2fe..51048b2af962e8226a5dbdbf349ef6ac99a95311 100644 (file)
@@ -91,6 +91,12 @@ static struct log_ref ferr_bgp_warn[] = {
                .description = "BGP has received a update packet with attributes that when parsed do not correctly add up to packet data length",
                .suggestion = "Gather log data from this and remote peer and open an Issue with this data",
        },
+       {
+               .code = BGP_WARN_DUMP,
+               .title = "BGP MRT dump subsystem has encountered an issue",
+               .description = "BGP has found that the attempted write of MRT data to a dump file has failed",
+               .suggestion = "Ensure BGP has permissions to write the specified file",
+       },
        {
                .code = END_FERR,
        }
index f9291b19f4ccbb565df1cefd4ec6c0e74ba1e811..34d1f67f6cbe76947fa3b30344f6fe86444328eb 100644 (file)
@@ -83,6 +83,7 @@ enum bgp_log_refs {
        BGP_WARN_ATTRIBUTE_PARSE_WITHDRAW,
        BGP_WARN_ATTRIBUTE_FETCH_ERROR,
        BGP_WARN_ATTRIBUTES_MISMATCH,
+       BGP_WARN_DUMP,
 };
 
 extern void bgp_error_init(void);