From: Donald Sharp Date: Wed, 15 Aug 2018 19:19:21 +0000 (-0400) Subject: bgpd: Convert bgp_dump.c to use flog_warn X-Git-Tag: frr-7.1-dev~371^2~48 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=7077f45c690b22c36003bea785a209be682648ad;p=mirror%2Ffrr.git bgpd: Convert bgp_dump.c to use flog_warn Signed-off-by: Donald Sharp --- diff --git a/bgpd/bgp_dump.c b/bgpd/bgp_dump.c index d69b1c46f2..49f27d298b 100644 --- a/bgpd/bgp_dump.c +++ b/bgpd/bgp_dump.c @@ -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; diff --git a/bgpd/bgp_errors.c b/bgpd/bgp_errors.c index 5b0c4b0da5..51048b2af9 100644 --- a/bgpd/bgp_errors.c +++ b/bgpd/bgp_errors.c @@ -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, } diff --git a/bgpd/bgp_errors.h b/bgpd/bgp_errors.h index f9291b19f4..34d1f67f6c 100644 --- a/bgpd/bgp_errors.h +++ b/bgpd/bgp_errors.h @@ -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);