summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-06-14 15:03:56 +0200
committerTom Gundersen <teg@jklm.no>2014-06-14 15:06:17 +0200
commitd9876a527f62e85c3c972bc5f45ad872cb4958c1 (patch)
tree6151bb8501eeabd123006a4fdde9c9014c587c2e /src
parentefdc73dae3e5d92b817e2418a0af6c43dfba877c (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/network/networkd-link.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index baa0756e6f..452fcd43c2 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -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;