[PATCH] Locking in BGP proto generates deadlocks with link-local addresses

Fritz Grimpen fritz at grimpen.net
Thu May 9 05:53:05 CEST 2013


Hi.

Today I have figured out that BIRD will generate a deadlock if you are
using the same remote address on multiple BGP protocols:

protocol bgp {
    neighbor fe80::1%tun1 as 1;
    local fe80::2 as 2;
}

protocol bgp {
    neighbor fe80::1%tun2 as 1;
    local fe80::2 as 3;
}

In this case, only one of these protocols will change it's state and
the other will stuck in Idle state forever. Here is my patch:

cat <<PATCH
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index 0f351b4..b1594b9 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -840,7 +840,6 @@ bgp_start(struct proto *P)
   lock->iface = p->cf->iface;
   lock->type = OBJLOCK_TCP;
   lock->port = BGP_PORT;
-  lock->iface = NULL;
   lock->hook = bgp_start_locked;
   lock->data = p;
   olock_acquire(lock);
PATCH

Fritz.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20130509/1846f368/attachment.asc>


More information about the Bird-users mailing list