]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Update bgp_updgrp_packet.c to use flog_warn
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 16 Aug 2018 16:07:50 +0000 (12:07 -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_errors.c
bgpd/bgp_errors.h
bgpd/bgp_updgrp_packet.c

index 6a0b0a9ee9926787a28ae4690484cf054db44f09..16ff336e68b54f5e11c19a56948e89c6f664728d 100644 (file)
@@ -181,6 +181,12 @@ static struct log_ref ferr_bgp_warn[] = {
                .description = "BGP has received a capability that it does not know how to decode.  This may be due to a new feature that has not been coded into FRR or it may be a bug in the remote peer",
                .suggestion = "Gather log files from here and from peer and open an Issue",
        },
+       {
+               .code = BGP_WARN_INVALID_NEXTHOP_LENGTH,
+               .title = "BGP is attempting to write an invalid nexthop length value",
+               .description = "BGP is in the process of building NLRI information for a peer and has discovered an inconsistent internal state",
+               .suggestion = "Gather log files and open an Issue, restart FRR",
+       },
        {
                .code = END_FERR,
        }
index 4de04f760e5d2deb096339df9fce14203de20126..f7db77ac387fa8026cc2f02e8796effef818e956 100644 (file)
@@ -98,6 +98,7 @@ enum bgp_log_refs {
        BGP_WARN_CAPABILITY_INVALID_DATA,
        BGP_WARN_CAPABILITY_VENDOR,
        BGP_WARN_CAPABILITY_UNKNOWN,
+       BGP_WARN_INVALID_NEXTHOP_LENGTH,
 };
 
 extern void bgp_error_init(void);
index c0761503f13c8ada0651449dca2aba483d8d68e6..cba3b07032b2711b74f1b61c54dce7dde98a2000 100644 (file)
@@ -427,9 +427,9 @@ struct stream *bpacket_reformat_for_peer(struct bpacket *pkt,
                                break;
                        default:
                                /* TODO: handle IPv6 nexthops */
-                               zlog_warn(
-                                       "%s: %s: invalid MP nexthop length (AFI IP): %u",
-                                       __func__, peer->host, nhlen);
+                               flog_warn(BGP_WARN_INVALID_NEXTHOP_LENGTH,
+                                         "%s: %s: invalid MP nexthop length (AFI IP): %u",
+                                         __func__, peer->host, nhlen);
                                stream_free(s);
                                return NULL;
                        }
@@ -532,9 +532,9 @@ struct stream *bpacket_reformat_for_peer(struct bpacket *pkt,
                                break;
                        default:
                                /* TODO: handle IPv4 nexthops */
-                               zlog_warn(
-                                       "%s: %s: invalid MP nexthop length (AFI IP6): %u",
-                                       __func__, peer->host, nhlen);
+                               flog_warn(BGP_WARN_INVALID_NEXTHOP_LENGTH,
+                                         "%s: %s: invalid MP nexthop length (AFI IP6): %u",
+                                         __func__, peer->host, nhlen);
                                stream_free(s);
                                return NULL;
                        }