Skip to content

Commit

Permalink
Load protocol-specific dictionaries if built with them.
Browse files Browse the repository at this point in the history
The code in parser.c does static evaluation of things like

	if (DHCP-foo == ...)

When the DHCP dictionaries aren't loaded, that turns into static
comparison of two strings, which is always false.  Changing it to

	if (&DHCP-foo == ...)

makes it bail with an unknown attribute error.  This is because
we don't have pass2 fixups for that case.
  • Loading branch information
alandekok committed Mar 11, 2014
1 parent 088636e commit 5db2bbd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/mainconfig.c
Expand Up @@ -788,6 +788,18 @@ int read_mainconfig(int reload)
return -1;
}

/*
* Try to load protocol-specific dictionaries. It's OK
* if they don't exist.
*/
#ifdef WITH_DHCP
dict_read(mainconfig.dictionary_dir, "dictionary.dhcp");
#endif

#ifdef WITH_VMPS
dict_read(mainconfig.dictionary_dir, "dictionary.vqp");
#endif

/*
* It's OK if this one doesn't exist.
*/
Expand Down

0 comments on commit 5db2bbd

Please sign in to comment.