summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ospfd/parse.y
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2010-02-16 08:22:42 +0000
committerdlg <dlg@openbsd.org>2010-02-16 08:22:42 +0000
commit37877ca4c948b93ec6c005528705b3f49d797ac1 (patch)
tree623074e2c3aa928452e3e7bbcad11eafc91275b2 /usr.sbin/ospfd/parse.y
parentPlug a memory leak in pushfile(). (diff)
downloadwireguard-openbsd-37877ca4c948b93ec6c005528705b3f49d797ac1.tar.xz
wireguard-openbsd-37877ca4c948b93ec6c005528705b3f49d797ac1.zip
allow spf-delay and spf-holdtime to be specified in msec so ospfd can
better respond to rapid topology changes. developed while working with joshua atterbury ok claudio@ as part of a larger diff.
Diffstat (limited to 'usr.sbin/ospfd/parse.y')
-rw-r--r--usr.sbin/ospfd/parse.y18
1 files changed, 14 insertions, 4 deletions
diff --git a/usr.sbin/ospfd/parse.y b/usr.sbin/ospfd/parse.y
index 004f4fef401..c26ac5fa290 100644
--- a/usr.sbin/ospfd/parse.y
+++ b/usr.sbin/ospfd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.68 2009/11/25 12:55:35 dlg Exp $ */
+/* $OpenBSD: parse.y,v 1.69 2010/02/16 08:22:42 dlg Exp $ */
/*
* Copyright (c) 2004, 2005 Esben Norby <norby@openbsd.org>
@@ -123,12 +123,13 @@ typedef struct {
%token RETRANSMITINTERVAL ROUTERDEADTIME ROUTERPRIORITY
%token SET TYPE
%token YES NO
+%token MSEC
%token DEMOTE
%token INCLUDE
%token ERROR
%token <v.string> STRING
%token <v.number> NUMBER
-%type <v.number> yesno no optlist optlist_l option demotecount
+%type <v.number> yesno no optlist optlist_l option demotecount msec
%type <v.string> string
%type <v.redist> redistribute
@@ -179,6 +180,14 @@ no : /* empty */ { $$ = 0; }
| NO { $$ = 1; }
;
+msec : MSEC NUMBER {
+ $$ = $2;
+ }
+ | NUMBER {
+ $$ = $1 * 1000;
+ }
+ ;
+
varset : STRING '=' string {
if (conf->opts & OSPFD_OPT_VERBOSE)
printf("%s = \"%s\"\n", $1, $3);
@@ -226,7 +235,7 @@ conf_main : ROUTERID STRING {
| RFC1583COMPAT yesno {
conf->rfc1583compat = $2;
}
- | SPFDELAY NUMBER {
+ | SPFDELAY msec {
if ($2 < MIN_SPF_DELAY || $2 > MAX_SPF_DELAY) {
yyerror("spf-delay out of range "
"(%d-%d)", MIN_SPF_DELAY,
@@ -235,7 +244,7 @@ conf_main : ROUTERID STRING {
}
conf->spf_delay = $2;
}
- | SPFHOLDTIME NUMBER {
+ | SPFHOLDTIME msec {
if ($2 < MIN_SPF_HOLDTIME || $2 > MAX_SPF_HOLDTIME) {
yyerror("spf-holdtime out of range "
"(%d-%d)", MIN_SPF_HOLDTIME,
@@ -694,6 +703,7 @@ lookup(char *s)
{"include", INCLUDE},
{"interface", INTERFACE},
{"metric", METRIC},
+ {"msec", MSEC},
{"no", NO},
{"passive", PASSIVE},
{"rdomain", RDOMAIN},