X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fodhcpd.git;a=blobdiff_plain;f=src%2Fdhcpv4.c;h=2093ecd037b173df7b286f9e08983dae945a8266;hp=9746aa2f3f9c6a8e88bc32683eed50d6821b5dcf;hb=98b41e5b07b28b438fb0be45ba294a932f4c849b;hpb=1bbf34a1df3e16865b3b9330b338952076bc26f9 diff --git a/src/dhcpv4.c b/src/dhcpv4.c index 9746aa2..2093ecd 100644 --- a/src/dhcpv4.c +++ b/src/dhcpv4.c @@ -491,7 +491,6 @@ static struct dhcpv4_assignment* dhcpv4_lease(struct interface *iface, } } - bool update_state = false; if (msg == DHCPV4_MSG_DISCOVER || msg == DHCPV4_MSG_REQUEST) { bool assigned = !!a; size_t hostlen = strlen(hostname) + 1; @@ -530,24 +529,18 @@ static struct dhcpv4_assignment* dhcpv4_lease(struct interface *iface, a = NULL; } - if (a) - update_state = true; - if (assigned && a) lease = a; } else if (msg == DHCPV4_MSG_RELEASE) { if (a) { a->valid_until = 0; - update_state = true; } } else if (msg == DHCPV4_MSG_DECLINE) { memset(a->hwaddr, 0, sizeof(a->hwaddr)); a->valid_until = now + 3600; // Block address for 1h - update_state = true; } - if (update_state) - dhcpv6_write_statefile(); + dhcpv6_write_statefile(); return lease; }