summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2004-04-25 19:12:58 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2004-04-25 19:12:58 +0000
commit1e9e7bb5589a779236267f9e1d9fcf867b5fc9d5 (patch)
tree7f648ba00ad0ccb9b1be42e6b500d97b93c55a5a
parent94a091e9d3493d307af62faea774a2a1d49909c7 (diff)
if remote-as was not configured, inherit the AS from the neighbors open
message for cloned neighbors, claudio ok
-rw-r--r--usr.sbin/bgpd/session.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c
index ab40ffe6e28..752f02e3f12 100644
--- a/usr.sbin/bgpd/session.c
+++ b/usr.sbin/bgpd/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.147 2004/04/25 18:21:18 henning Exp $ */
+/* $OpenBSD: session.c,v 1.148 2004/04/25 19:12:57 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -1462,6 +1462,10 @@ parse_open(struct peer *peer)
memcpy(&as, p, sizeof(as));
p += sizeof(as);
+ /* if remote-as is zero and it's a cloned neighbor, accept any */
+ if (peer->conf.cloned && !peer->conf.remote_as)
+ peer->conf.remote_as = ntohs(as);
+
if (peer->conf.remote_as != ntohs(as)) {
log_peer_warnx(&peer->conf, "peer sent wrong AS %u", ntohs(as));
session_notification(peer, ERR_OPEN, ERR_OPEN_AS, NULL, 0);