summaryrefslogtreecommitdiffstats
path: root/proto
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2008-08-25 01:20:46 +0200
committerOndrej Filip <feela@network.cz>2008-08-25 01:20:46 +0200
commit85ae398a61184d8f7a353eacaa6aefd3422dfd71 (patch)
tree06affc9070e31e67fead6bf3e5e17b695ab30b53 /proto
parenta456788bce7f9d1e54b19ffbfd35b8fa889c4b47 (diff)
downloadbird-85ae398a61184d8f7a353eacaa6aefd3422dfd71.tar
bird-85ae398a61184d8f7a353eacaa6aefd3422dfd71.zip
The source address configuration in BGP added.
Diffstat (limited to 'proto')
-rw-r--r--proto/bgp/attrs.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c
index 459335f..30699f8 100644
--- a/proto/bgp/attrs.c
+++ b/proto/bgp/attrs.c
@@ -576,7 +576,12 @@ bgp_create_attrs(struct bgp_proto *p, rte *e, ea_list **attrs, struct linpool *p
if (p->cf->next_hop_self ||
!p->is_internal ||
rta->dest != RTD_ROUTER)
- *(ip_addr *)z = p->local_addr;
+ {
+ if (ipa_nonzero(p->cf->source_addr))
+ *(ip_addr *)z = p->cf->source_addr;
+ else
+ *(ip_addr *)z = p->local_addr;
+ }
else
*(ip_addr *)z = e->attrs->gw;