summaryrefslogtreecommitdiffstats
path: root/proto/bgp/bgp.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-12-08 09:00:13 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-12-09 06:08:58 +0100
commit93a508df6028dc838117d620f0daee6c6d15ccbf (patch)
tree7f3fe51a2a18539826b02897d604de5195ba4ee1 /proto/bgp/bgp.c
parent631487aa2d45aa2078a08f1852e4a7482abbc2b5 (diff)
downloadbird-93a508df6028dc838117d620f0daee6c6d15ccbf.tar
bird-93a508df6028dc838117d620f0daee6c6d15ccbf.zip
BGP: Add support for specifying interface names to allow peerings using link-local addressesll-peering-old2
Diffstat (limited to 'proto/bgp/bgp.c')
-rw-r--r--proto/bgp/bgp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index 675342d..e537fce 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -579,6 +579,7 @@ bgp_connect(struct bgp_proto *p) /* Enter Connect state and start establishing c
s->saddr = p->source_addr;
s->daddr = p->cf->remote_ip;
s->dport = BGP_PORT;
+ s->iface = p->neigh->iface;
s->ttl = p->cf->ttl_security ? 255 : hops;
s->rbsize = BGP_RX_BUFFER_SIZE;
s->tbsize = BGP_TX_BUFFER_SIZE;
@@ -793,7 +794,7 @@ bgp_start_locked(struct object_lock *lock)
return;
}
- p->neigh = neigh_find(&p->p, &cf->remote_ip, NEF_STICKY);
+ p->neigh = neigh_find_ifname(&p->p, &cf->remote_ip, (*cf->interface) ? cf->interface : NULL, NEF_STICKY);
if (!p->neigh || (p->neigh->scope == SCOPE_HOST))
{
log(L_ERR "%s: Invalid remote address %I", p->p.name, cf->remote_ip);
@@ -807,7 +808,7 @@ bgp_start_locked(struct object_lock *lock)
if (p->neigh->iface)
bgp_start_neighbor(p);
else
- BGP_TRACE(D_EVENTS, "Waiting for %I to become my neighbor", cf->remote_ip);
+ BGP_TRACE(D_EVENTS, "Waiting for %I to become my neighbor%s%s", cf->remote_ip, (*cf->interface) ? " on " : "", cf->interface);
}
static int
@@ -852,6 +853,7 @@ bgp_start(struct proto *P)
lock->iface = NULL;
lock->hook = bgp_start_locked;
lock->data = p;
+
olock_acquire(lock);
return PS_START;