From 1e9e7bb5589a779236267f9e1d9fcf867b5fc9d5 Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Sun, 25 Apr 2004 19:12:58 +0000 Subject: if remote-as was not configured, inherit the AS from the neighbors open message for cloned neighbors, claudio ok --- usr.sbin/bgpd/session.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'usr.sbin/bgpd/session.c') 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 @@ -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); -- cgit v1.2.3