Skip to content

Commit

Permalink
Merge pull request #401 from mtomaschewski/dhcp-no-release
Browse files Browse the repository at this point in the history
dhcp4: do not release and remove lease without request (bnc#866994)
  • Loading branch information
olafhering committed Sep 3, 2014
2 parents 60fef7d + d235e1e commit 2454fd7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions dhcp4/fsm.c
Expand Up @@ -53,7 +53,9 @@ ni_dhcp4_defer_timeout(void *user_data, const ni_timer_t *timer)
ni_warn("%s: bad timer handle", __func__);
return;
}
ni_note("%s: DHCLIENT_WAIT_AT_BOOT=%u reached (state %s)", dev->ifname, dev->config->defer_timeout, ni_dhcp4_fsm_state_name(dev->fsm.state));
ni_note("%s: defer timeout %u reached (state %s)",
dev->ifname, dev->config->defer_timeout,
ni_dhcp4_fsm_state_name(dev->fsm.state));
ni_dhcp4_send_event(NI_DHCP4_EVENT_DEFERRED, dev, NULL);
}

Expand Down Expand Up @@ -473,9 +475,12 @@ ni_dhcp4_fsm_release(ni_dhcp4_device_t *dev)
if (dev->config->release_lease) {
ni_debug_dhcp("%s: releasing lease", dev->ifname);
ni_dhcp4_device_send_message(dev, DHCP4_RELEASE, dev->lease);
ni_dhcp4_fsm_commit_lease(dev, NULL);
} else {
ni_dhcp4_device_drop_lease(dev);
ni_dhcp4_send_event(NI_DHCP4_EVENT_RELEASED, dev, NULL);
ni_dhcp4_fsm_restart(dev);
}

ni_dhcp4_fsm_commit_lease(dev, NULL);
}

/*
Expand Down

0 comments on commit 2454fd7

Please sign in to comment.