Skip to content

fix(reapply): add PRESERVE_DHCP reapply flag to skip DHCP restart - #26

Merged
Zeno-sole merged 1 commit into
deepin-community:masterfrom
ut003640:master
Jun 29, 2026
Merged

fix(reapply): add PRESERVE_DHCP reapply flag to skip DHCP restart#26
Zeno-sole merged 1 commit into
deepin-community:masterfrom
ut003640:master

Conversation

@ut003640

Copy link
Copy Markdown
Contributor

When switching primary connection by toggling never-default via reapply,the DHCP client was unnecessarily restarted, causing a lease renegotiation that blocked the switch for several seconds. With PRESERVE_DHCP flag set, the reapply path keeps the DHCP client alive and only updates the l3cd merge-flags, so default routes are correctly filtered without touching DHCP.

  • Add NM_DEVICE_REAPPLY_FLAGS_PRESERVE_DHCP (0x2) to NMDeviceReapplyFlags enum
  • Skip DHCP cleanup/start in _dev_ipdhcpx_cleanup when preserve_dhcp is set
  • Re-register existing l3cds after MANUALIP rebuild to propagate updated merge-flags (including NO_DEFAULT_ROUTES) to DHCP/LL/AC l3cds
  • Add debug logging for reapply preserve-dhcp flow

通过reapply切换never-default来切换主连接时,DHCP客户端会被不必要地重启, 导致租约重新协商,阻塞切换数秒。设置PRESERVE_DHCP标志后,reapply路径会保持DHCP客户端存活,仅更新l3cd的merge-flags,从而在不触碰DHCP的情况下正确过滤默认路由。

  • 新增 NM_DEVICE_REAPPLY_FLAGS_PRESERVE_DHCP (0x2) 到 NMDeviceReapplyFlags 枚举
  • 在 _dev_ipdhcpx_cleanup 中当 preserve_dhcp 设置时跳过DHCP清理/启动
  • 在MANUALIP重建后重新注册已有的l3cd,将更新的merge-flags(包括NO_DEFAULT_ROUTES)传播到DHCP/LL/AC l3cd
  • 添加reapply preserve-dhcp流程的调试日志

PMS: BUG-351163

When switching primary connection by toggling never-default via reapply,the DHCP client was unnecessarily restarted, causing a lease renegotiation that blocked the switch for several seconds. With PRESERVE_DHCP flag set, the reapply path keeps the DHCP client alive and only updates the l3cd merge-flags, so default routes are correctly filtered without touching DHCP.

- Add NM_DEVICE_REAPPLY_FLAGS_PRESERVE_DHCP (0x2) to NMDeviceReapplyFlags enum
- Skip DHCP cleanup/start in _dev_ipdhcpx_cleanup when preserve_dhcp is set
- Re-register existing l3cds after MANUALIP rebuild to propagate updated merge-flags (including NO_DEFAULT_ROUTES) to DHCP/LL/AC l3cds
- Add debug logging for reapply preserve-dhcp flow

通过reapply切换never-default来切换主连接时,DHCP客户端会被不必要地重启, 导致租约重新协商,阻塞切换数秒。设置PRESERVE_DHCP标志后,reapply路径会保持DHCP客户端存活,仅更新l3cd的merge-flags,从而在不触碰DHCP的情况下正确过滤默认路由。

- 新增 NM_DEVICE_REAPPLY_FLAGS_PRESERVE_DHCP (0x2) 到 NMDeviceReapplyFlags 枚举
- 在 _dev_ipdhcpx_cleanup 中当 preserve_dhcp 设置时跳过DHCP清理/启动
- 在MANUALIP重建后重新注册已有的l3cd,将更新的merge-flags(包括NO_DEFAULT_ROUTES)传播到DHCP/LL/AC l3cd
- 添加reapply preserve-dhcp流程的调试日志

PMS: BUG-351163
@github-actions

Copy link
Copy Markdown

TAG Bot

TAG: 1.44.2-7deepin10
EXISTED: no
DISTRIBUTION: unstable

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

Hi @ut003640. Thanks for your PR.

I'm waiting for a deepin-community member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@ut003640

Copy link
Copy Markdown
Contributor Author

/forcemarge

@ut003640

Copy link
Copy Markdown
Contributor Author

/merge

@deepin-community-ci-bot

Copy link
Copy Markdown

Merge" command is disabled

@ut003640

Copy link
Copy Markdown
Contributor Author

/forcemerge

@Zeno-sole
Zeno-sole merged commit 8ba9b1b into deepin-community:master Jun 29, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants