networkd: use OrderedSets instead of strvs to store lists of domains

We were already using OrderedSets in the manager object, but strvs in the
configuration parsing code. Using sets gives us better scaling when many
domains are used.

In oss-fuzz #13059 the attached reproducer takes approximately 30.5 s to be
parsed. Converting to sets makes this go down to 10s. This is not _vastly_
faster, but using sets seems like a nicer approach anyway. In particular, we
avoid the quadratic de-unification operation after each addition.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2019-02-21 12:04:27 +01:00
parent 53ae3f6467
commit 5e2a51d588
6 changed files with 39 additions and 36 deletions
Binary file not shown.