diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2014-03-31 00:56:44 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2014-03-31 01:52:28 +0200 |
commit | d7c0628591b802e202903b63fce53b6a422a3db2 (patch) | |
tree | 2202050e07a73c435785565b6e74e0116f8fad39 /nest/config.Y | |
parent | 0c3d9dacafdb807d2101c67610969707353f434a (diff) |
Check validity of interface definitions.
Thanks to Aleksey Berezin for the bugreport.
Diffstat (limited to 'nest/config.Y')
-rw-r--r-- | nest/config.Y | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/nest/config.Y b/nest/config.Y index 59d354b8..5b544e59 100644 --- a/nest/config.Y +++ b/nest/config.Y @@ -24,6 +24,17 @@ static list *this_p_list; static struct password_item *this_p_item; static int password_id; +static void +iface_patt_check(void) +{ + struct iface_patt_node *pn; + + WALK_LIST(pn, this_ipatt->ipn_list) + if (!pn->pattern || pn->pxlen) + cf_error("Interface name/mask expected, not IP prefix"); +} + + static inline void reset_passwords(void) { @@ -272,6 +283,9 @@ iface_patt_list: | iface_patt_list ',' iface_patt_node ; +/* For name/mask-only iface patterns */ +iface_patt_list_nopx: iface_patt_list { iface_patt_check(); } + iface_patt_init: { /* Generic this_ipatt init */ this_ipatt = cfg_allocz(sizeof(struct iface_patt)); |