Skip to content

fix(network): prevent ping-pong switching in multi-NIC scenario#571

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
ut003640:master
Jun 29, 2026
Merged

fix(network): prevent ping-pong switching in multi-NIC scenario#571
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
ut003640:master

Conversation

@ut003640

Copy link
Copy Markdown
Contributor

Replace m_isSwitching flag with a cooldown timer in InternetChecker to avoid frequent route switching. The cooldown starts at the beginning of switchInternetAccess() and lasts for connectivityCheckInterval, covering both the switching process and post-switch stabilization.

Add a proactive accessibility check at the entry of switchInternetAccess() to verify the primary connection before initiating a switch, skipping unnecessary switching when the current connection is already functional.

Restore realStartCheck() to its original structure, removing the snapshot logic (m_checkStartPrimaryId) that checked for primary connection changes during the check, since the proactive check in InternetChecker handles this case more cleanly.

Also fix reapplyConnection to pass the correct flags parameter.

PMS:BUG-351163

Replace m_isSwitching flag with a cooldown timer in InternetChecker to
avoid frequent route switching. The cooldown starts at the beginning of
switchInternetAccess() and lasts for connectivityCheckInterval, covering
both the switching process and post-switch stabilization.

Add a proactive accessibility check at the entry of switchInternetAccess()
to verify the primary connection before initiating a switch, skipping
unnecessary switching when the current connection is already functional.

Restore realStartCheck() to its original structure, removing the snapshot
logic (m_checkStartPrimaryId) that checked for primary connection changes
during the check, since the proactive check in InternetChecker handles this
case more cleanly.

Also fix reapplyConnection to pass the correct flags parameter.

PMS:BUG-351163

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @ut003640, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: caixr23, ut003640

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ut003640

Copy link
Copy Markdown
Contributor Author

/merge

@deepin-bot deepin-bot Bot merged commit bbfbd44 into linuxdeepin:master Jun 29, 2026
16 checks passed
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.

3 participants