diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2020-08-13 18:35:27 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-13 18:35:27 -0400 |
| commit | ff35d21a1c2a32c27c559419f55cbef8917ce13e (patch) | |
| tree | 044b3c5d948135786d2f1e88d376c1490d01aaaf | |
| parent | 3a9bc619cf39fe751ac3e17f8e94277d716aa3f3 (diff) | |
| parent | 599f7b330def526148343af8d7913c76983d2884 (diff) | |
Merge pull request #6913 from ton31337/feature/dump_attributes_for_debugging_if_malformed
bgpd: Dump attributes before returning from bgp_attr_malformed()
| -rw-r--r-- | bgpd/bgp_attr.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index 948055e375..27be7787f3 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -1150,6 +1150,7 @@ bgp_attr_malformed(struct bgp_attr_parser_args *args, uint8_t subcode, bgp_size_t length) { struct peer *const peer = args->peer; + struct attr *const attr = args->attr; const uint8_t flags = args->flags; /* startp and length must be special-cased, as whether or not to * send the attribute data with the NOTIFY depends on the error, @@ -1157,6 +1158,14 @@ bgp_attr_malformed(struct bgp_attr_parser_args *args, uint8_t subcode, */ uint8_t *notify_datap = (length > 0 ? args->startp : NULL); + if (bgp_debug_update(peer, NULL, NULL, 1)) { + char attr_str[BUFSIZ] = {0}; + + bgp_dump_attr(attr, attr_str, BUFSIZ); + + zlog_debug("%s: attributes: %s", __func__, attr_str); + } + /* Only relax error handling for eBGP peers */ if (peer->sort != BGP_PEER_EBGP) { bgp_notify_send_with_data(peer, BGP_NOTIFY_UPDATE_ERR, subcode, |
