]> git.ipfire.org Git - people/ms/suricata.git/commit - src/util-device.c
util-device: fix LiveBuildDeviceListCustom
authorEric Leblond <eric@regit.org>
Sun, 25 Jan 2015 18:31:45 +0000 (19:31 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 8 May 2015 09:37:12 +0000 (11:37 +0200)
commit43f691fef8d003edf6a6c849edb91d9be6f6082b
tree33227a52f99a998ced0e4bd5db95ac60fcb335f7
parent268285c49f2ab2141c9217cc21aeffbf366cb555
util-device: fix LiveBuildDeviceListCustom

The code was assuming that the dictionnary containing the parameter
of a interface was ordered. But for YAML, the order is not assumed
so in case the configuration is generated we may not be able to
parse correctly the configuration file.

By iterating on child on main node and then iterating on subchild
and doing a match on the name, we are able to find the interface
list. In term of code, this algorithm was obtained by simply
removing the test on the name of the first child.
src/util-device.c