diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c index 851223a860..78f89e026e 100644 --- a/src/network/networkd-ndisc.c +++ b/src/network/networkd-ndisc.c @@ -764,6 +764,9 @@ int config_parse_ndisc_black_listed_prefix( continue; } + if (set_contains(network->ndisc_black_listed_prefix, &ip.in6)) + continue; + r = set_ensure_allocated(&network->ndisc_black_listed_prefix, &in6_addr_hash_ops); if (r < 0) return log_oom(); @@ -774,12 +777,8 @@ int config_parse_ndisc_black_listed_prefix( r = set_put(network->ndisc_black_listed_prefix, a); if (r < 0) { - if (r == -EEXIST) - log_syntax(unit, LOG_WARNING, filename, line, r, - "NDISC black listed prefixs is duplicated, ignoring assignment: %s", n); - else - log_syntax(unit, LOG_ERR, filename, line, r, - "Failed to store NDISC black listed prefix '%s', ignoring assignment: %m", n); + log_syntax(unit, LOG_ERR, filename, line, r, + "Failed to store NDISC black listed prefix '%s', ignoring assignment: %m", n); continue; } diff --git a/test/fuzz/fuzz-network-parser/oss-fuzz-15678 b/test/fuzz/fuzz-network-parser/oss-fuzz-15678 new file mode 100644 index 0000000000..2a37d5f455 --- /dev/null +++ b/test/fuzz/fuzz-network-parser/oss-fuzz-15678 @@ -0,0 +1,2 @@ +[IPv6AcceptRA] +BlackList=70:: 70:: \ No newline at end of file