diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-08-16 15:29:23 +0200 |
---|---|---|
committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2018-09-06 22:50:58 +0200 |
commit | 065eaa36290decd582bd299855bbc86a890b07c2 (patch) | |
tree | 00290377dc2e7f04f7e8953e3378a6b27785bd34 /bgpd/bgp_open.c | |
parent | bgpd: convert bgp_nht.c to use flog_warn (diff) | |
download | frr-065eaa36290decd582bd299855bbc86a890b07c2.tar.xz frr-065eaa36290decd582bd299855bbc86a890b07c2.zip |
bgpd: Convert bgp_open.c to use flog_warn
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to '')
-rw-r--r-- | bgpd/bgp_open.c | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/bgpd/bgp_open.c b/bgpd/bgp_open.c index 5bdee5f51..2a32f02f4 100644 --- a/bgpd/bgp_open.c +++ b/bgpd/bgp_open.c @@ -254,7 +254,8 @@ static int bgp_capability_mp(struct peer *peer, struct capability_header *hdr) /* Verify length is 4 */ if (hdr->length != 4) { - zlog_warn( + flog_warn( + BGP_WARN_CAPABILITY_INVALID_LENGTH, "MP Cap: Received invalid length %d, non-multiple of 4", hdr->length); return -1; @@ -449,7 +450,8 @@ static int bgp_capability_restart(struct peer *peer, /* Verify length is a multiple of 4 */ if ((caphdr->length - 2) % 4) { - zlog_warn( + flog_warn( + BGP_WARN_CAPABILITY_INVALID_LENGTH, "Restart Cap: Received invalid length %d, non-multiple of 4", caphdr->length); return -1; @@ -546,7 +548,8 @@ static int bgp_capability_addpath(struct peer *peer, /* Verify length is a multiple of 4 */ if (hdr->length % 4) { - zlog_warn( + flog_warn( + BGP_WARN_CAPABILITY_INVALID_LENGTH, "Add Path: Received invalid length %d, non-multiple of 4", hdr->length); return -1; @@ -604,7 +607,8 @@ static int bgp_capability_enhe(struct peer *peer, struct capability_header *hdr) /* Verify length is a multiple of 4 */ if (hdr->length % 6) { - zlog_warn( + flog_warn( + BGP_WARN_CAPABILITY_INVALID_LENGTH, "Extended NH: Received invalid length %d, non-multiple of 6", hdr->length); return -1; @@ -646,7 +650,8 @@ static int bgp_capability_enhe(struct peer *peer, struct capability_header *hdr) if (afi != AFI_IP || nh_afi != AFI_IP6 || !(safi == SAFI_UNICAST || safi == SAFI_LABELED_UNICAST)) { - zlog_warn( + flog_warn( + BGP_WARN_CAPABILITY_INVALID_DATA, "%s Unexpected afi/safi/next-hop afi: %u/%u/%u " "in Extended Next-hop capability, ignoring", peer->host, pkt_afi, pkt_safi, pkt_nh_afi); @@ -677,7 +682,8 @@ static int bgp_capability_hostname(struct peer *peer, len = stream_getc(s); if (stream_get_getp(s) + len > end) { - zlog_warn( + flog_warn( + BGP_WARN_CAPABILITY_INVALID_DATA, "%s: Received malformed hostname capability from peer %s", __FUNCTION__, peer->host); return -1; @@ -707,7 +713,8 @@ static int bgp_capability_hostname(struct peer *peer, } if (stream_get_getp(s) + 1 > end) { - zlog_warn( + flog_warn( + BGP_WARN_CAPABILITY_INVALID_DATA, "%s: Received invalid domain name len (hostname capability) from peer %s", __FUNCTION__, peer->host); return -1; @@ -715,7 +722,8 @@ static int bgp_capability_hostname(struct peer *peer, len = stream_getc(s); if (stream_get_getp(s) + len > end) { - zlog_warn( + flog_warn( + BGP_WARN_CAPABILITY_INVALID_DATA, "%s: Received runt domain name (hostname capability) from peer %s", __FUNCTION__, peer->host); return -1; @@ -952,10 +960,12 @@ static int bgp_capability_parse(struct peer *peer, size_t length, specific capabilities. It seems reasonable for now... */ - zlog_warn("%s Vendor specific capability %d", + flog_warn(BGP_WARN_CAPABILITY_VENDOR, + "%s Vendor specific capability %d", peer->host, caphdr.code); } else { - zlog_warn( + flog_warn( + BGP_WARN_CAPABILITY_UNKNOWN, "%s unrecognized capability code: %d - ignored", peer->host, caphdr.code); memcpy(*error, sp, caphdr.length + 2); @@ -970,7 +980,8 @@ static int bgp_capability_parse(struct peer *peer, size_t length, } if (stream_get_getp(s) != (start + caphdr.length)) { if (stream_get_getp(s) > (start + caphdr.length)) - zlog_warn( + flog_warn( + BGP_WARN_CAPABILITY_INVALID_LENGTH, "%s Cap-parser for %s read past cap-length, %u!", peer->host, lookup_msg(capcode_str, caphdr.code, |