From: claudio Date: Thu, 2 Jun 2022 11:12:47 +0000 (+0000) Subject: Adjust lowest allowed routing priority to be bigger than RTP_LOCAL. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=af6b1ec3d0a0e293f7e5474ef0dd5ae5b37a67ed;p=openbsd Adjust lowest allowed routing priority to be bigger than RTP_LOCAL. RTP_LOCAL is internally used by the kernel and is not available for userland. The minimal usable routing prio is 2. OK tb@ --- diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y index 7e85fb25c9c..dfd00462759 100644 --- a/usr.sbin/bgpd/parse.y +++ b/usr.sbin/bgpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.427 2022/06/02 11:05:15 claudio Exp $ */ +/* $OpenBSD: parse.y,v 1.428 2022/06/02 11:12:47 claudio Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer @@ -707,9 +707,9 @@ conf_main : AS as4number { TAILQ_INSERT_TAIL(conf->listen_addrs, la, entry); } | FIBPRIORITY NUMBER { - if ($2 < RTP_LOCAL || $2 > RTP_MAX) { + if ($2 <= RTP_LOCAL || $2 > RTP_MAX) { yyerror("fib-priority %lld must be between " - "%u and %u", $2, RTP_LOCAL, RTP_MAX); + "%u and %u", $2, RTP_LOCAL + 1, RTP_MAX); YYERROR; } conf->fib_priority = $2; @@ -1045,9 +1045,9 @@ network : NETWORK prefix filter_set { } | NETWORK family PRIORITY NUMBER filter_set { struct network *n; - if ($4 < RTP_LOCAL && $4 > RTP_MAX) { + if ($4 <= RTP_LOCAL && $4 > RTP_MAX) { yyerror("priority %lld must be between " - "%u and %u", $4, RTP_LOCAL, RTP_MAX); + "%u and %u", $4, RTP_LOCAL + 1, RTP_MAX); YYERROR; }