On Thu, Mar 09, 2017 at 04:29:40PM +0200, Lennert Buytenhek wrote:
This patch implements the latter option, and this functionality is enabled by specifying two different remote AS numbers for a peer in the neighbor statement. Instead of specifying:
neighbor 1.2.3.4 as 12345;
Specify this:
neighbor 1.2.3.4 as 12345 as 23456;
I would prefer if the secondary as would either have a separate keyword, (e.g. neighbor 1.2.3.4 as 12345 secondary as 23456) or it was just plain positional (e.g. neighbor 1.2.3.4 as 12345 23456).
(bird's config grammar already allows specifying multiple remote AS numbers for a peer, and it will use the last AS number you specify this way if you do that. With this patch, it will use the last two AS numbers you specify.) --- proto/bgp/bgp.c | 17 +++++++++-------- proto/bgp/bgp.h | 2 +- proto/bgp/config.Y | 2 +- proto/bgp/packets.c | 8 ++++++-- 4 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/proto/bgp/bgp.c b/proto/bgp/bgp.c index 0f1c944..bceae4a 100644 --- a/proto/bgp/bgp.c +++ b/proto/bgp/bgp.c @@ -1278,8 +1278,6 @@ bgp_init(struct proto_config *C)
p->cf = c; p->local_as = c->local_as; - p->remote_as = c->remote_as; - p->is_internal = (c->local_as == c->remote_as); p->rs_client = c->rs_client; p->rr_client = c->rr_client; p->igp_table = get_igp_table(c); @@ -1291,8 +1289,6 @@ bgp_init(struct proto_config *C) void bgp_check_config(struct bgp_config *c) { - int internal = (c->local_as == c->remote_as); -
I don't like changes in bgp_check_config(). I think that if you set remote_as as EBGP, while remote_as2 as IBGP, you could end up with inconsistent settings. IMHO allowing remote_as2 only in EBGP makes sense, as in IBGP remote ASN must be the same as local ASN. So we could make internal / is_internal fixed, as it was. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."