From 2e4959060e5112c379f473bde9f4d8047f6174d0 Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Fri, 26 Jan 2007 21:34:22 +0000 Subject: AS 65535 aka USHRT_MAX is reserved and may not be used so adapt the range check. Found while hacking on 4-byte AS support. --- usr.sbin/bgpd/parse.y | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y index 4d5b93f9755..556ffe943f3 100644 --- a/usr.sbin/bgpd/parse.y +++ b/usr.sbin/bgpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.198 2006/12/05 12:08:13 henning Exp $ */ +/* $OpenBSD: parse.y,v 1.199 2007/01/26 21:34:21 claudio Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer @@ -217,8 +217,8 @@ number : STRING { ; asnumber : number { - if ($1 > USHRT_MAX) { - yyerror("AS too big: max %u", USHRT_MAX); + if ($1 >= USHRT_MAX) { + yyerror("AS too big: max %u", USHRT_MAX - 1); YYERROR; } } -- cgit v1.2.3