Skip to content

Refactor confd deps#1511

Open
mattiaswal wants to merge 3 commits into
mainfrom
refactor-confd-deps
Open

Refactor confd deps#1511
mattiaswal wants to merge 3 commits into
mainfrom
refactor-confd-deps

Conversation

@mattiaswal
Copy link
Copy Markdown
Contributor

@mattiaswal mattiaswal commented May 22, 2026

  • Refactor dependency tracking in confd/core.c
  • Add dependecy tracking for wireguard keys
  • Move dependency checking for hostname changes from dhcp-client to the dependency tracker

Description

Checklist

Tick relevant boxes, this PR is-a or has-a:

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
    • ChangeLog updated (for major changes)
  • Other (please describe):

Extract the monolithic handle_dependencies() into five smaller
functions, each handling one dependency type:

 - dep_symmetric_keys()    - key -> wifi secret
 - dep_asymmetric_keys()   - key -> ssh hostkey/web cert
 - dep_hostname()          - hostname -> dhcp-server/mdns
 - dep_wifi_interfaces()   - interface wifi -> radio hardware
 - dep_radio_components()  - radio hardware -> interface wifi

Also fixes a potential NULL dereference of dwifi before accessing
its access-point child, and removes redundant NULL checks for
YANG-guaranteed mandatory leaves (list keys, mandatory true).
When keystore keys change, trigger regeneration of wireguard
interfaces that reference them:

 - Asymmetric key change: triggers interfaces using it as private-key
 - Symmetric key change: triggers interfaces using it as preshared-key
   (both at peers bag-level and individual peer-level)
Move the hostname-triggers-dhcp-client logic from dhcp-client.c into
the centralized dep_hostname() dependency tracker.  When the hostname
changes, all interfaces with DHCP client configured are now added to
the diff by the core dependency resolver, so dhcp_client_change() picks
them up through its normal diff-based interface iteration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant