From: Ondrej Filip Date: Sun, 24 Aug 2008 23:20:46 +0000 (+0000) Subject: The source address configuration in BGP added. X-Git-Tag: v1.2.0~205 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85ae398a61184d8f7a353eacaa6aefd3422dfd71;p=thirdparty%2Fbird.git The source address configuration in BGP added. --- diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c index 459335fac..30699f84d 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;