]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/network/networkd-network.c
networkd: use OrderedSets instead of strvs to store lists of domains
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 20 Feb 2019 21:50:25 +0000 (22:50 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 21 Feb 2019 11:04:27 +0000 (12:04 +0100)
commit5e2a51d588dde4b52c6017ea80b75c16e6e23431
tree62f5b22923f9f6c5fabbbc58d1e8ddb03e99eed0
parent53ae3f6467b48aa89cff3ec22a54e7e164681f01
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.
src/network/networkd-link.c
src/network/networkd-manager.c
src/network/networkd-network.c
src/network/networkd-network.h
src/network/networkd-radv.c
test/fuzz/fuzz-network-parser/oss-fuzz-13059 [new file with mode: 0644]