diff options
author | Ondrej Filip <feela@network.cz> | 2008-08-24 23:20:46 +0000 |
---|---|---|
committer | Ondrej Filip <feela@network.cz> | 2008-08-24 23:20:46 +0000 |
commit | 85ae398a61184d8f7a353eacaa6aefd3422dfd71 (patch) | |
tree | 06affc9070e31e67fead6bf3e5e17b695ab30b53 /proto/bgp | |
parent | a456788bce7f9d1e54b19ffbfd35b8fa889c4b47 (diff) |
The source address configuration in BGP added.
Diffstat (limited to 'proto/bgp')
-rw-r--r-- | proto/bgp/attrs.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c index 459335fa..30699f84 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; |