number of dynamically created network interfaces with the same network configuration and
automatic address range assignment.</para>
+ <para>If an empty string is specified, then the all previous assignments in both [Network] and
+ [Address] sections are cleared.</para>
+
<xi:include href="version-info.xml" xpointer="v211"/>
</listitem>
</varlistentry>
assert(rvalue);
assert(data);
- if (streq(section, "Network"))
+ if (streq(section, "Network")) {
+ if (isempty(rvalue)) {
+ /* If an empty string specified in [Network] section, clear previously assigned addresses. */
+ network->addresses_by_section = ordered_hashmap_free_with_destructor(network->addresses_by_section, address_free);
+ return 0;
+ }
+
/* we are not in an Address section, so use line number instead. */
r = address_new_static(network, filename, line, &n);
- else
+ } else
r = address_new_static(network, filename, section_line, &n);
if (r == -ENOMEM)
return log_oom();