-
Notifications
You must be signed in to change notification settings - Fork 14
Hostname stability #1258
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
troglobit
wants to merge
7
commits into
main
Choose a base branch
from
hostname-stability
base: main
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
Hostname stability #1258
+413
−111
Conversation
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
mattiaswal
reviewed
Nov 17, 2025
mattiaswal
approved these changes
Nov 17, 2025
Contributor
mattiaswal
left a comment
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.
👍 Just one improvement for future testsystems
Resolve race condition between DHCP and configured hostname by introducing priority-based hostname management using /etc/hostname.d/ directory pattern. Priority order (highest wins): 90-dhcp-<iface> - DHCP assigned hostname 50-configured - YANG /system/hostname config 10-default - Bootstrap/factory default The new /usr/libexec/infix/hostname helper reads all sources and applies the highest priority hostname. It exits early if hostname unchanged, preventing unnecessary service restarts. Fixes #1112 Signed-off-by: Joachim Wiberg <[email protected]>
673c380 to
24cf703
Compare
Validate that DHCP options were requested in the parameter request list before applying them. This prevents malicious or misconfigured DHCP servers from forcing unwanted configuration changes. Validates: hostname (12), DNS (6), domain (15), search (119), router (3), static routes (121), and NTP (42). Fail-safe behavior: rejects options if config file unavailable. Signed-off-by: Joachim Wiberg <[email protected]>
Signed-off-by: Joachim Wiberg <[email protected]>
This change exposes the macvlan mode to tests, unlocking support for running certain types of tests on systems with only a single Ethernet port. Signed-off-by: Joachim Wiberg <[email protected]>
Set PYTHONPYCACHEDIR=/tmp/__pycache__ in test/env to avoid permission issues during git cleanup operations. When tests run in Docker containers as root, __pycache__ directories and .pyc files end up owned by root, preventing the CI user from cleaning them up. Signed-off-by: Joachim Wiberg <[email protected]>
Verify deterministic hostname management via /etc/hostname.d/, rules: 1. Configured hostname takes precedence over default 2. DHCP hostname takes precedence over configured 3. Hostname reverts when DHCP lease ends Signed-off-by: Joachim Wiberg <[email protected]>
Fixes #1255 Signed-off-by: Joachim Wiberg <[email protected]>
24cf703 to
76fc013
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Resolve race condition between DHCP and configured hostname by introducing a priority-based hostname management system using a
/etc/hostname.d/directory pattern.Checklist
Tick relevant boxes, this PR is-a or has-a: