summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2014-01-17 14:04:36 +0100
committerSteven Barth <steven@midlink.org>2014-01-17 14:04:36 +0100
commit0a41d480c058b68fe09ac7de044c561dee955233 (patch)
tree945f606a00cf8746e5e8d2cb5e8fdf2beb8f3dac
parentbaee1992982f92a45870ba0aaea111c00963de5d (diff)
Fix a segfault in state-script handling
-rw-r--r--src/dhcpv6-ia.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/dhcpv6-ia.c b/src/dhcpv6-ia.c
index 2e93bd0..88840a4 100644
--- a/src/dhcpv6-ia.c
+++ b/src/dhcpv6-ia.c
@@ -211,7 +211,7 @@ void dhcpv6_write_statefile(void)
if (iface->dhcpv6 != RELAYD_SERVER && iface->dhcpv4 != RELAYD_SERVER)
continue;
- if (iface->dhcpv6 == RELAYD_SERVER) {
+ if (iface->dhcpv6 == RELAYD_SERVER && iface->ia_assignments.next) {
struct dhcpv6_assignment *c;
list_for_each_entry(c, &iface->ia_assignments, head) {
if (c->clid_len == 0)
@@ -262,7 +262,7 @@ void dhcpv6_write_statefile(void)
}
}
- if (iface->dhcpv4 == RELAYD_SERVER) {
+ if (iface->dhcpv4 == RELAYD_SERVER && iface->dhcpv4_assignments.next) {
struct dhcpv4_assignment *c;
list_for_each_entry(c, &iface->dhcpv4_assignments, head) {
char ipbuf[INET6_ADDRSTRLEN];