-
Notifications
You must be signed in to change notification settings - Fork 303
xcp-networkd: dhclient cleanup (v2) #7162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
semarie
wants to merge
8
commits into
xapi-project:master
Choose a base branch
from
xcp-ng:dev/srt/master/dhcp-client-cleanup2
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0a4fcbb
Interface.make_config: do not update update_config in advance
semarie 6fa6d28
networkd: make Dhclient.stop to stop the DHCP client managing the int…
semarie a3c1652
networkd: Dhclient: remove unneeded ignore and make Dhclient.start to…
semarie 3c129dd
dhclient: add comments on functions
semarie f27ea41
dhclient: add `set_stale` (and remove `remove_conf_file`) in public i…
semarie 3b0fbde
networkd: Dhclient.is_running: check the dhclient process to be gone
semarie 3d3e2ee
networkd: Dhclient.stop: allow to not release addresses while stopping
semarie 2a454e2
networkd: refactor set_ipv{4,6}_conf functions
semarie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test case does host-management-reconfigure, then pif-reconfigure-ip the old management pif DHCP-> none, but the IP on old management pif still exists.
In fact, A simple DHCP4 -> None4 can reproduce this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am looking. thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it seems at time of
set_ipv4_confcall,get_config nameis already set to the new value.it makes the deconfiguration step to be wrong.
I am putting the PR in draft for now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I have identified the source of the problem.
Interface.make_configis first callingupdate_configwith the new configuration, before iterating on each parameter to callset_dns,set_ipv4_conf,set_ipv4_gateway, etc... each function is also updating the configuration (to a parameter which is already up-to-date). so whenset_ipv4_confis called, the previous configuration is already lost.by removing the call of
update_configfromInterface.make_configit makesconfigto be updated incrementally by each function on the fly (I checked that every function called byInterface.make_configis callingupdate_config).but I am unsure if it is the right path as it would have some side-effects : previously an exception in
set_dns(function chosen for example, exception possible inXapi_stdext_unix.Unixext.write_string_to_file) would abortInterface.make_configin the middle butconfigwould be still totally updated (leading system and config state unsynchronized). so I don't know if it would fix bugs or open some new ones.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pushed a new commit to avoid calling
update_configahead inInterface.make_config.I take care that each field in
interface_config_tto be updated (so added explicitlyset_persistentcall).