summaryrefslogtreecommitdiffstats
path: root/proto/bgp/bgp.c
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2010-12-14 03:26:51 +0100
committerMatthias Schiffer <mschiffer@universe-factory.net>2010-12-14 03:26:51 +0100
commit7a03ded81bf2d07331d8fb87c2c7613cb4dd518e (patch)
tree50e5ca2856f97d1e0c875c02bf2cb8887815c4ab /proto/bgp/bgp.c
parente91f6960bae16314e9429719c2c2321edb484a44 (diff)
downloadbird-7a03ded81bf2d07331d8fb87c2c7613cb4dd518e.tar
bird-7a03ded81bf2d07331d8fb87c2c7613cb4dd518e.zip
BGP: Added support for peering with link-local IPv6 addresses
Diffstat (limited to 'proto/bgp/bgp.c')
-rw-r--r--proto/bgp/bgp.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c
index 327292a..84c353e 100644
--- a/proto/bgp/bgp.c
+++ b/proto/bgp/bgp.c
@@ -574,6 +574,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->multihop ? : 1;
s->rbsize = BGP_RX_BUFFER_SIZE;
s->tbsize = BGP_TX_BUFFER_SIZE;
@@ -743,6 +744,7 @@ bgp_start_locked(struct object_lock *lock)
{
struct bgp_proto *p = lock->data;
struct bgp_config *cf = p->cf;
+ struct iface *interface = NULL;
if (p->p.proto_state != PS_START)
{
@@ -759,7 +761,16 @@ bgp_start_locked(struct object_lock *lock)
return;
}
- p->neigh = neigh_find(&p->p, &cf->remote_ip, NEF_STICKY);
+ if (*cf->interface) {
+ interface = if_find_by_name(cf->interface);
+
+ if (!interface) {
+ BGP_TRACE(D_EVENTS, "Waiting for interface %s", cf->interface);
+ return;
+ }
+ }
+
+ p->neigh = neigh_find2(&p->p, &cf->remote_ip, interface, NEF_STICKY);
if (!p->neigh || (p->neigh->scope == SCOPE_HOST))
{
log(L_ERR "%s: Invalid remote address %I", p->p.name, cf->remote_ip);