Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP4:GA
wicked.6334
0001-dhcp-clear-hostname-on-lease-recovery-rebo...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-dhcp-clear-hostname-on-lease-recovery-reboot.patch of Package wicked.6334
From 9590d61a86cf5e0aecaef60a43376ba75d26b1f2 Mon Sep 17 00:00:00 2001 From: Nirmoy Das <ndas@suse.de> Date: Thu, 23 Nov 2017 15:28:57 +0100 Subject: [PATCH] dhcp: clear hostname on lease recovery/reboot(bsc#1057007) ref:https://gitlab.suse.de/mtomaschewski/wicked/commit/7f7b696d1db281b4198f15f07ab3cabace0e25d5 diff --git a/src/dhcp4/fsm.c b/src/dhcp4/fsm.c index 1cb6cfe1..c1dce55f 100644 --- a/src/dhcp4/fsm.c +++ b/src/dhcp4/fsm.c @@ -400,6 +400,7 @@ __ni_dhcp4_fsm_discover(ni_dhcp4_device_t *dev, int scan_offers) lease->uuid = dev->config->uuid; lease->fqdn.enabled = NI_TRISTATE_DEFAULT; lease->fqdn.qualify = dev->config->fqdn.qualify; + ni_string_free(&lease->hostname); dev->fsm.state = NI_DHCP4_STATE_SELECTING; dev->dhcp4.accept_any_offer = 1; @@ -528,6 +529,10 @@ ni_dhcp4_fsm_reboot(ni_dhcp4_device_t *dev) deadline = expire_time; dev->config->capture_timeout = deadline - now; + dev->lease->fqdn.enabled = NI_TRISTATE_DEFAULT; + dev->lease->fqdn.qualify = dev->config->fqdn.qualify; + ni_string_free(&dev->lease->hostname); + ni_dhcp4_fsm_set_timeout(dev, dev->config->capture_timeout); ni_dhcp4_device_send_message(dev, DHCP4_REQUEST, dev->lease); } @@ -940,6 +945,7 @@ ni_dhcp4_recover_lease(ni_dhcp4_device_t *dev) lease->fqdn.enabled = NI_TRISTATE_DEFAULT; lease->fqdn.qualify = dev->config->fqdn.qualify; + ni_string_free(&lease->hostname); /* We cannot renew/rebind/reboot without it */ ni_sockaddr_set_ipv4(&addr, lease->dhcp4.server_id, 0); diff --git a/src/dhcp4/protocol.c b/src/dhcp4/protocol.c index 553c16c9..0a7ceaaa 100644 --- a/src/dhcp4/protocol.c +++ b/src/dhcp4/protocol.c @@ -1091,7 +1091,6 @@ __ni_dhcp4_build_msg_request_reboot(const ni_dhcp4_device_t *dev, unsigned int msg_code = DHCP4_REQUEST; ni_dhcp4_message_t *message; ni_sockaddr_t addr; - const ni_dhcp_fqdn_t *fqdn; /* Request an lease after reboot to reuse old lease (no server id) */ ni_sockaddr_set_ipv4(&addr, lease->dhcp4.address, 0); @@ -1115,12 +1114,8 @@ __ni_dhcp4_build_msg_request_reboot(const ni_dhcp4_device_t *dev, "%s: using reused ip-address: %s", dev->ifname, ni_sockaddr_print(&addr)); - if (lease->fqdn.enabled == NI_TRISTATE_DEFAULT) - fqdn = &options->fqdn; - else - fqdn = &lease->fqdn; - if (__ni_dhcp4_build_msg_put_our_hostname(dev, msgbuf, fqdn, - lease->hostname ? lease->hostname : options->hostname) < 0) + if (__ni_dhcp4_build_msg_put_our_hostname(dev, msgbuf, &options->fqdn, + options->hostname) < 0) return -1; if (__ni_dhcp4_build_msg_put_option_request(dev, msg_code, msgbuf) < 0) -- 2.13.6
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor