networkd: add assert
It should not be possible to have a DHCP lease on a link without also having an associated network. Add assert() to avoid compiler warnings. Reported by Thomas H. P. Andersen
This commit is contained in:
parent
efdc73dae3
commit
d9876a527f
|
@ -2152,6 +2152,8 @@ int link_save(Link *link) {
|
|||
}
|
||||
|
||||
if (link->dhcp_lease) {
|
||||
assert(link->network);
|
||||
|
||||
r = dhcp_lease_save(link->dhcp_lease, link->lease_file);
|
||||
if (r < 0)
|
||||
goto finish;
|
||||
|
|
Loading…
Reference in New Issue