]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: Squash spurious "unknown afi" log messages
authorPaul Jakma <paul.jakma@hpe.com>
Fri, 22 Apr 2016 11:48:49 +0000 (12:48 +0100)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 26 Oct 2016 13:36:09 +0000 (09:36 -0400)
* 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>

bgpd/bgp_packet.c

index fd414f912c1b452fcdd0de6407401f1b6825e12f..796a57f054f9ca88b19be9b24c30375abc46eb13 100644 (file)
@@ -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