summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/parse.y
diff options
context:
space:
mode:
authorPeter Hessler <phessler@cvs.openbsd.org>2017-08-21 14:41:23 +0000
committerPeter Hessler <phessler@cvs.openbsd.org>2017-08-21 14:41:23 +0000
commit8169ba6704ec5641d9f7b0d9ff01ad9f7377c2d2 (patch)
tree5dc339a181004597b4167580fc11bcd732ad4b7b /usr.sbin/bgpd/parse.y
parentb9e3b28de8afb5a9b2b708f59e34eed2b7ba49a8 (diff)
When 'enforce neighbor-as no' is set, don't do a config-time check for the neighbor-as, as it is dynamic.
Diffstat (limited to 'usr.sbin/bgpd/parse.y')
-rw-r--r--usr.sbin/bgpd/parse.y12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index cffd852110a..1841961ed48 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.314 2017/08/12 16:47:50 phessler Exp $ */
+/* $OpenBSD: parse.y,v 1.315 2017/08/21 14:41:22 phessler Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -3705,11 +3705,6 @@ neighbor_consistent(struct peer *p)
return (-1);
}
- if (p->conf.remote_as == 0) {
- yyerror("peer AS may not be zero");
- return (-1);
- }
-
/* set default values if they where undefined */
p->conf.ebgp = (p->conf.remote_as != conf->as);
if (p->conf.announce_type == ANNOUNCE_UNDEF)
@@ -3721,6 +3716,11 @@ neighbor_consistent(struct peer *p)
if (p->conf.enforce_local_as == ENFORCE_AS_UNDEF)
p->conf.enforce_local_as = ENFORCE_AS_ON;
+ if (p->conf.remote_as == 0 && p->conf.enforce_as != ENFORCE_AS_OFF) {
+ yyerror("peer AS may not be zero");
+ return (-1);
+ }
+
/* EBGP neighbors are not allowed in route reflector clusters */
if (p->conf.reflector_client && p->conf.ebgp) {
yyerror("EBGP neighbors are not allowed in route "