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:
Tom Gundersen 2014-06-14 15:03:56 +02:00
parent efdc73dae3
commit d9876a527f
1 changed files with 2 additions and 0 deletions

View File

@ -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;