Skip to content

fix(wifi/hotspot): retry with different frequency on AP mode timeout#24

Merged
Zeno-sole merged 2 commits into
deepin-community:masterfrom
ut003640:master
Jun 11, 2026
Merged

fix(wifi/hotspot): retry with different frequency on AP mode timeout#24
Zeno-sole merged 2 commits into
deepin-community:masterfrom
ut003640:master

Conversation

@ut003640

@ut003640 ut003640 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

When creating a WiFi hotspot with auto channel selection (channel=0),the supplicant may time out on certain frequencies due to driver issues or regulatory restrictions. Instead of failing immediately, retry with a different frequency up to 4 times before giving up.

The failed frequency is recorded and skipped in subsequent attempts,so each retry tries a genuinely different channel.

修复WiFi热点在自动选信道时因驱动或法规限制导致超时的问题。
当热点创建超时时不立即失败,而是依次尝试不同频率,最多重试4次。
每次超时的频率会被记录并在后续重试中跳过,确保每次都尝试真正不同的信道。

PMS: BUG-353699

When creating a WiFi hotspot with auto channel selection (channel=0),the supplicant may time out on certain frequencies due to driver issues or regulatory restrictions. Instead of failing immediately, retry with a different frequency up to 4 times before giving up.

The failed frequency is recorded and skipped in subsequent attempts,so each retry tries a genuinely different channel.

修复WiFi热点在自动选信道时因驱动或法规限制导致超时的问题。
当热点创建超时时不立即失败,而是依次尝试不同频率,最多重试4次。
每次超时的频率会被记录并在后续重试中跳过,确保每次都尝试真正不同的信道。

PMS: BUG-353699
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

TAG Bot

TAG: 1.44.2-7deepin9
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.

@deepin-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: caixr23
Once this PR has been reviewed and has the lgtm label, please assign utsweetyfish for approval. For more information see the Code Review Process.

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

ut003640 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

/forcemerge

@Zeno-sole

Copy link
Copy Markdown
Contributor

/integrate

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

AutoIntegrationPr Bot
auto integrate with pr url: deepin-community/Repository-Integration#4138
PrNumber: 4138
PrBranch: auto-integration-27180920336

@Zeno-sole

Copy link
Copy Markdown
Contributor

/integrate

@Zeno-sole

Copy link
Copy Markdown
Contributor

/integrate

@Zeno-sole

Copy link
Copy Markdown
Contributor

/integrate

@Zeno-sole

Copy link
Copy Markdown
Contributor

/integrate

@ut003640 ut003640 force-pushed the master branch 2 times, most recently from e87d1f8 to 2fa5fe0 Compare June 10, 2026 06:43
@Zeno-sole

Copy link
Copy Markdown
Contributor

/integrate

@Zeno-sole

Zeno-sole commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

📌 新增接口分析

是的,存在新增接口! 但需要澄清:这个PR 本身没有新增接口,而是暴露了一个之前存在但未完全集成的接口

🔍 新增接口详情

公开 API 函数

int nm_setting_connection_get_autoconnect_reset_retries(NMSettingConnection *setting)

文件: src/libnm-core-public/nm-setting-connection.h

说明:

  • 这是一个已存在的函数,但在此PR中被完整地集成到公开API中
  • 用途:获取连接的 autoconnect-reset-retries 属性值
  • 返回值:-1、0 或 1
    • -1:使用全局默认配置
    • 0:不重置(达到重试次数后不再自动重试)
    • 1:重置后重新尝试

版本标记: NM_AVAILABLE_IN_1_6(表示从 NetworkManager 1.6 版本开始可用)


📊 接口暴露的改动

1️⃣ 库符号导出 (libnm.ver)

+ nm_setting_connection_get_autoconnect_reset_retries;

将函数添加到公共库符号表,允许外部调用

2️⃣ 头文件声明 (nm-setting-connection.h)

NM_AVAILABLE_IN_1_6
int nm_setting_connection_get_autoconnect_reset_retries(NMSettingConnection *setting);

公开声明新的 getter 函数

3️⃣ 元数据注册 (XML 文件)

  • gen-metadata-nm-settings-libnm-core.xml.in:定义属性的 D-Bus 类型和 GObject 属性
  • gen-metadata-nm-settings-nmcli.xml.in:更新 nmcli 工具的元数据和描述文本

4️⃣ 单元测试更新 (test-general.c)

{NM_SETTING_CONNECTION_AUTOCONNECT_RESET_RETRIES, NM_SETTING_DIFF_RESULT_IN_A},

添加常量到单元测试,确保差异检测覆盖新属性


⚠️ 重要注意

这个PR涉及的是连接设置属性的接口暴露,与热点重试逻辑(主要改动)分开

方面 说明
热点重试逻辑 nm-device-wifi.c 中实现,是内部设备管理逻辑
公开接口 nm_setting_connection_get_autoconnect_reset_retries() 用于读取连接配置
关系 热点重试逻辑利用连接的 autoconnect-reset-retries 属性来控制重试行为

@Zeno-sole

Copy link
Copy Markdown
Contributor

📌 新增接口分析

是的,存在新增接口! 但需要澄清:这个PR 本身没有新增接口,而是暴露了一个之前存在但未完全集成的接口

🔍 新增接口详情

公开 API 函数

int nm_setting_connection_get_autoconnect_reset_retries(NMSettingConnection *setting)

文件: src/libnm-core-public/nm-setting-connection.h

说明:

  • 这是一个已存在的函数,但在此PR中被完整地集成到公开API中

  • 用途:获取连接的 autoconnect-reset-retries 属性值

  • 返回值:-1、0 或 1

    • -1:使用全局默认配置
    • 0:不重置(达到重试次数后不再自动重试)
    • 1:重置后重新尝试

版本标记: NM_AVAILABLE_IN_1_6(表示从 NetworkManager 1.6 版本开始可用)

📊 接口暴露的改动

1️⃣ 库符号导出 (libnm.ver)

+ nm_setting_connection_get_autoconnect_reset_retries;

将函数添加到公共库符号表,允许外部调用

2️⃣ 头文件声明 (nm-setting-connection.h)

NM_AVAILABLE_IN_1_6
int nm_setting_connection_get_autoconnect_reset_retries(NMSettingConnection *setting);

公开声明新的 getter 函数

3️⃣ 元数据注册 (XML 文件)

  • gen-metadata-nm-settings-libnm-core.xml.in:定义属性的 D-Bus 类型和 GObject 属性
  • gen-metadata-nm-settings-nmcli.xml.in:更新 nmcli 工具的元数据和描述文本

4️⃣ 单元测试更新 (test-general.c)

{NM_SETTING_CONNECTION_AUTOCONNECT_RESET_RETRIES, NM_SETTING_DIFF_RESULT_IN_A},

添加常量到单元测试,确保差异检测覆盖新属性

⚠️ 重要注意

这个PR涉及的是连接设置属性的接口暴露,与热点重试逻辑(主要改动)分开

方面 说明
热点重试逻辑nm-device-wifi.c 中实现,是内部设备管理逻辑
公开接口 nm_setting_connection_get_autoconnect_reset_retries() 用于读取连接配置
关系 热点重试逻辑利用连接的 autoconnect-reset-retries 属性来控制重试行为

@BLumia 这种算是新增接口么?

@Zeno-sole

Copy link
Copy Markdown
Contributor

/integrate

@ut003640

Copy link
Copy Markdown
Contributor Author

/integrate

@ut003640

Copy link
Copy Markdown
Contributor Author

/integrate

@ut003640

Copy link
Copy Markdown
Contributor Author

/integrate

1 similar comment
@ut003640

Copy link
Copy Markdown
Contributor Author

/integrate

@ut003640

Copy link
Copy Markdown
Contributor Author

/integrate

@ut003640

Copy link
Copy Markdown
Contributor Author

/integrate

… property

Fix test_connection_diff_a_only assertion failure (29 != 28) and metadata
XML inconsistency caused by adding autoconnect-reset-retries to NMSettingConnection.

Closes deepin-community#2
@ut003640

Copy link
Copy Markdown
Contributor Author

/integrate

1 similar comment
@ut003640

Copy link
Copy Markdown
Contributor Author

/integrate

@Zeno-sole Zeno-sole merged commit 8b9b76d into deepin-community:master Jun 11, 2026
2 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