summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/parse.y
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2018-09-21 08:17:16 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2018-09-21 08:17:16 +0000
commit646132055679874c25c6d6822041c7fd38e147b3 (patch)
tree17c7be4bcc9996bed2d11e1cb270c0f91cc91d0a /usr.sbin/bgpd/parse.y
parent70e3a082b7dff5133619cb0c725520a56d114275 (diff)
Both AS 23456 and AS 0 are reserved and can nor be used. Extend check for
AS 0 and adjust yyerror message to print the right number. With input and OK denis@
Diffstat (limited to 'usr.sbin/bgpd/parse.y')
-rw-r--r--usr.sbin/bgpd/parse.y10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index 66d5a3a4a94..d50657655c5 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.358 2018/09/21 08:15:33 claudio Exp $ */
+/* $OpenBSD: parse.y,v 1.359 2018/09/21 08:17:15 claudio Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -297,17 +297,17 @@ as4number : STRING {
free($1);
YYERROR;
}
- if (uvalh == 0 && uval == AS_TRANS) {
+ if (uvalh == 0 && (uval == AS_TRANS || uval == 0)) {
yyerror("AS %u is reserved and may not be used",
- AS_TRANS);
+ uval);
YYERROR;
}
$$ = uval | (uvalh << 16);
}
| asnumber {
- if ($1 == AS_TRANS) {
+ if ($1 == AS_TRANS || $1 == 0) {
yyerror("AS %u is reserved and may not be used",
- AS_TRANS);
+ (u_int32_t)$1);
YYERROR;
}
$$ = $1;