diff options
Diffstat (limited to 'proto/bgp/bgp.c')
-rw-r--r-- | proto/bgp/bgp.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index 41c8d533..a0bc8923 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -500,10 +500,7 @@ bgp_connect(struct bgp_proto *p) /* Enter Connect state and start establishing c DBG("BGP: Connecting\n"); s = sk_new(p->p.pool); s->type = SK_TCP_ACTIVE; - if (ipa_nonzero(p->cf->source_addr)) - s->saddr = p->cf->source_addr; - else - s->saddr = p->local_addr; + s->saddr = p->source_addr; s->daddr = p->cf->remote_ip; s->dport = BGP_PORT; s->ttl = p->cf->multihop ? : 1; @@ -609,7 +606,9 @@ static void bgp_start_neighbor(struct bgp_proto *p) { p->local_addr = p->neigh->iface->addr->ip; - DBG("BGP: local=%I remote=%I\n", p->local_addr, p->next_hop); + p->source_addr = ipa_nonzero(p->cf->source_addr) ? p->cf->source_addr : p->local_addr; + + DBG("BGP: local=%I remote=%I\n", p->source_addr, p->next_hop); #ifdef IPV6 { struct ifa *a; |