summaryrefslogtreecommitdiff
path: root/proto
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2019-09-17 14:45:14 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2019-09-17 14:45:14 +0200
commiteb1e43a9af9e1905b754f1f191d228e2676ce181 (patch)
treef9aedacfe1d39d312da7bf9dbb90bd5a8abbe4cc /proto
parent5235c3f78da15826b0654ba68dc7a897faa42c98 (diff)
BGP: Fix setup with multiple dynamic BGP ranges
Based on a patch from Liam Nattrass, thanks.
Diffstat (limited to 'proto')
-rw-r--r--proto/bgp/bgp.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index b26e5e87..d6c2b7e4 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -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;