]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: Make bgp_info_cmp robust to paths that do not have su_remote info
authorTimo Teräs <timo.teras@iki.fi>
Wed, 24 Jun 2015 12:27:21 +0000 (15:27 +0300)
committervivek <vivek@cumulusnetworks.com>
Mon, 6 Jun 2016 16:14:25 +0000 (09:14 -0700)
My original su_remote == NULL check is not correct. It seems that

* bgp_route.c: (bgp_info_cmp) Some bgp_info is compared with su_remote=NULL
  and it's supposed to be perfectly legal.  E.g.  configured subnet announces
  ("network a.b.c.d/n"). Ensure bgp_info_cmp is robust if such a path gets
  as far as the neighbour address comparison step.

(cherry picked from commit 2820a01eed1c616d490ddbfd17793c19597459d1)

Conflicts:
bgpd/bgp_route.c

bgpd/bgp_route.c

index 171b5c7addf06a679c33375ea78226bbfbc0678e..f04d6db53bedcb405d86e616f9ecefb08c1e31d7 100644 (file)
@@ -803,6 +803,12 @@ bgp_info_cmp (struct bgp *bgp, struct bgp_info *new, struct bgp_info *exist,
       return 0;
     }
 
+  /* locally configured routes to advertise do not have su_remote */
+  if (new->peer->su_remote == NULL)
+    return 0;
+  if (exist->peer->su_remote == NULL)
+    return 1;
+  
   ret = sockunion_cmp (new->peer->su_remote, exist->peer->su_remote);
 
   if (ret == 1)