diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2009-08-31 13:03:32 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2009-08-31 13:03:32 +0000 |
commit | 6d6be4848445d3989ec1d654b09cd35891f1e71e (patch) | |
tree | 17e2b87e1383bb0cb42acf53c2c3a6820700bb22 /usr.sbin/bgpd | |
parent | 3972e6bc2168a5042ad01ec58356eba191cfaf16 (diff) |
Use UINT_MAX instead of ASNUM_MAX and get rid of this mostly useless define.
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r-- | usr.sbin/bgpd/bgpd.h | 4 | ||||
-rw-r--r-- | usr.sbin/bgpd/parse.y | 10 |
2 files changed, 8 insertions, 6 deletions
diff --git a/usr.sbin/bgpd/bgpd.h b/usr.sbin/bgpd/bgpd.h index 7c08e1f9a7e..b6a03723b26 100644 --- a/usr.sbin/bgpd/bgpd.h +++ b/usr.sbin/bgpd/bgpd.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bgpd.h,v 1.243 2009/07/23 14:53:18 claudio Exp $ */ +/* $OpenBSD: bgpd.h,v 1.244 2009/08/31 13:03:31 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -42,8 +42,6 @@ #define IPSEC_ENC_KEY_LEN 32 #define IPSEC_AUTH_KEY_LEN 20 -#define ASNUM_MAX 0xffffffff - #define MAX_PKTSIZE 4096 #define MIN_HOLDTIME 3 #define READ_BUF_SIZE 65535 diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y index 2ef9f9d1b8a..14afa6318a3 100644 --- a/usr.sbin/bgpd/parse.y +++ b/usr.sbin/bgpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.233 2009/08/03 13:14:07 claudio Exp $ */ +/* $OpenBSD: parse.y,v 1.234 2009/08/31 13:03:31 claudio Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -211,8 +211,12 @@ grammar : /* empty */ ; asnumber : NUMBER { - if ($1 < 0 || $1 >= ASNUM_MAX) { - yyerror("AS too big: max %u", ASNUM_MAX - 1); + /* + * Accroding to iana 65535 and 4294967295 are reserved + * but enforcing this is not duty of the parser. + */ + if ($1 < 0 || $1 > UINT_MAX) { + yyerror("AS too big: max %u", UINT_MAX); YYERROR; } } |