summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_packet.c
diff options
context:
space:
mode:
authorPaul Jakma <paul.jakma@hpe.com>2016-04-22 13:48:49 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2016-10-26 15:36:09 +0200
commit8628876f661045722f3db18e367379445bfecdb3 (patch)
tree5c21840733ff291d9007ddc40d5a1ce6dcece230 /bgpd/bgp_packet.c
parentbgpd: Remove the double-pass parsing of NLRIs (diff)
downloadfrr-8628876f661045722f3db18e367379445bfecdb3.tar.xz
frr-8628876f661045722f3db18e367379445bfecdb3.zip
bgpd: Squash spurious "unknown afi" log messages
* bgp_packet.c: (bgp_update_receive) doesn't differentiate between NLRIs that are 0 AFI/SAFI cause they weren't set, and those because a peer sent a bogus AFI/SAFI, before sending sending what may be a misleading, spurious log message. Check the .nlri pointer is set and avoid this. Incorporating a suggestion from: G. Paul Ziemba <unp@ziemba.us>
Diffstat (limited to 'bgpd/bgp_packet.c')
-rw-r--r--bgpd/bgp_packet.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c
index fd414f912..796a57f05 100644
--- a/bgpd/bgp_packet.c
+++ b/bgpd/bgp_packet.c
@@ -1506,6 +1506,9 @@ bgp_update_receive (struct peer *peer, bgp_size_t size)
/* Parse any given NLRIs */
for (int i = NLRI_UPDATE; i < NLRI_TYPE_MAX; i++)
{
+ if (!nlris[i].nlri)
+ continue;
+
/* We use afi and safi as indices into tables and what not. It would
* be impossible, at this time, to support unknown afi/safis. And
* anyway, the peer needs to be configured to enable the afi/safi