summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormcbride <mcbride@openbsd.org>2006-03-16 06:17:42 +0000
committermcbride <mcbride@openbsd.org>2006-03-16 06:17:42 +0000
commitaddc91ab941c676495e5df939fd87db941befd36 (patch)
treeee814ce27fffd1f2714d17d94d1191b8c50e7e4e
parentKill useless arguments to libevent *_set() functions. (diff)
downloadwireguard-openbsd-addc91ab941c676495e5df939fd87db941befd36.tar.xz
wireguard-openbsd-addc91ab941c676495e5df939fd87db941befd36.zip
Error out of ifstate.conf parsing instead of dumping core in operation
when a undefined ruleset is referenced. Fixes PR5049. Report and troubleshooting from Michael Knudsen.
-rw-r--r--usr.sbin/ifstated/parse.y7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/ifstated/parse.y b/usr.sbin/ifstated/parse.y
index d5097200a20..ce11264f93f 100644
--- a/usr.sbin/ifstated/parse.y
+++ b/usr.sbin/ifstated/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.11 2006/01/20 00:01:20 millert Exp $ */
+/* $OpenBSD: parse.y,v 1.12 2006/03/16 06:17:42 mcbride Exp $ */
/*
* Copyright (c) 2004 Ryan McBride <mcbride@openbsd.org>
@@ -700,6 +700,11 @@ link_states(struct ifsd_action *action)
break;
}
}
+ if (state == NULL) {
+ fprintf(stderr, "error: state '%s' not declared\n",
+ action->act.statename);
+ errors++;
+ }
break;
}
case IFSD_ACTION_CONDITION: