]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix RELEASE support.
authorRoy Marples <roy@marples.name>
Thu, 4 Apr 2013 21:58:51 +0000 (21:58 +0000)
committerRoy Marples <roy@marples.name>
Thu, 4 Apr 2013 21:58:51 +0000 (21:58 +0000)
dhcp.c

diff --git a/dhcp.c b/dhcp.c
index 12efea99a3a3f61202ac036e9fe4933632e91f02..480c24f9cd5c3b4188beb2a1ec0c413f95db3e5b 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -1665,9 +1665,13 @@ dhcp_expire(void *arg)
 void
 dhcp_release(struct interface *ifp)
 {
-       struct dhcp_state *state = D_STATE(ifp);
+       struct dhcp_state *state;
        struct timespec ts;
 
+       state = D_STATE(ifp);
+       if (state == NULL)
+               return;
+
        if (state->new != NULL && state->new->cookie == htonl(MAGIC_COOKIE)) {
                syslog(LOG_INFO, "%s: releasing lease of %s",
                    ifp->name, inet_ntoa(state->lease.addr));