]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
BGP: Fix setup with multiple dynamic BGP ranges
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Tue, 17 Sep 2019 12:45:14 +0000 (14:45 +0200)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Tue, 17 Sep 2019 12:45:14 +0000 (14:45 +0200)
Based on a patch from Liam Nattrass, thanks.

proto/bgp/bgp.c

index b26e5e87193ef63a9dbcc70488b2f41a0b2492df..d6c2b7e461ad5c1350854d492152a151094b9246 100644 (file)
@@ -1551,6 +1551,14 @@ bgp_start(struct proto *P)
   lock->type = OBJLOCK_TCP;
   lock->hook = bgp_start_locked;
   lock->data = p;
+
+  /* For dynamic BGP, we use inst 1 to avoid collisions with regular BGP */
+  if (bgp_is_dynamic(p))
+  {
+    lock->addr = net_prefix(p->cf->remote_range);
+    lock->inst = 1;
+  }
+
   olock_acquire(lock);
 
   return PS_START;