From: Donald Sharp Date: Thu, 16 Aug 2018 16:07:50 +0000 (-0400) Subject: bgpd: Update bgp_updgrp_packet.c to use flog_warn X-Git-Tag: frr-7.1-dev~371^2~41 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=78cb65556877087ab3d8d03e611c83ca6a455ed2;p=mirror%2Ffrr.git bgpd: Update bgp_updgrp_packet.c to use flog_warn Signed-off-by: Donald Sharp --- diff --git a/bgpd/bgp_errors.c b/bgpd/bgp_errors.c index 6a0b0a9ee9..16ff336e68 100644 --- a/bgpd/bgp_errors.c +++ b/bgpd/bgp_errors.c @@ -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, } diff --git a/bgpd/bgp_errors.h b/bgpd/bgp_errors.h index 4de04f760e..f7db77ac38 100644 --- a/bgpd/bgp_errors.h +++ b/bgpd/bgp_errors.h @@ -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); diff --git a/bgpd/bgp_updgrp_packet.c b/bgpd/bgp_updgrp_packet.c index c0761503f1..cba3b07032 100644 --- a/bgpd/bgp_updgrp_packet.c +++ b/bgpd/bgp_updgrp_packet.c @@ -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; }