chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
efdc73d
)
networkd: add assert
author
Tom Gundersen
<teg@jklm.no>
Sat, 14 Jun 2014 13:03:56 +0000
(15:03 +0200)
committer
Tom Gundersen
<teg@jklm.no>
Sat, 14 Jun 2014 13:06:17 +0000
(15:06 +0200)
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
src/network/networkd-link.c
patch
|
blob
|
history
diff --git
a/src/network/networkd-link.c
b/src/network/networkd-link.c
index baa0756e6fc3791148a36c215b6ce6bfa9e9152b..452fcd43c2203fa0c6cb7f4eafeefa245eed68e1 100644
(file)
--- 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) {
}
if (link->dhcp_lease) {
+ assert(link->network);
+
r = dhcp_lease_save(link->dhcp_lease, link->lease_file);
if (r < 0)
goto finish;
r = dhcp_lease_save(link->dhcp_lease, link->lease_file);
if (r < 0)
goto finish;