Skip to content

Fix build on Linux 7.2 - #374

Closed
zukunftsfirmaDE wants to merge 1 commit into
Mange:realtek-4.4.xfrom
zukunftsfirmaDE:fix-kernel-7.2-compat
Closed

zukunftsfirmaDE wants to merge 1 commit into
Mange:realtek-4.4.xfrom
zukunftsfirmaDE:fix-kernel-7.2-compat

Conversation

@zukunftsfirmaDE

Copy link
Copy Markdown

Linux 7.2 breaks the build in two independent ways.

strncpy() is gone: it is no longer declared in <linux/string.h> and the symbol is no longer available, completing the long-running migration to strscpy(). The driver calls it in ten places and depends on its NUL-padding semantics, which strscpy() does not provide (it also truncates at count - 1), so a private implementation is added rather than converting the call sites.

struct cfg80211_ops::remain_on_channel gained a trailing "const u8 *rx_addr" argument, so cfg80211_rtw_remain_on_channel no longer matches the callback type.

Both changes are guarded on LINUX_VERSION_CODE >= 7.2.0 and are inactive on older kernels.

Tested on 7.2.3 (clang 23, ThinLTO) and on 7.0.10 (gcc): both build with no errors and produce a module with the expected vermagic.

Linux 7.2 breaks the build in two independent ways.

strncpy() is gone: it is no longer declared in <linux/string.h> and the
symbol is no longer available, completing the long-running migration to
strscpy(). The driver calls it in ten places and depends on its
NUL-padding semantics, which strscpy() does not provide (it also
truncates at count - 1), so a private implementation is added rather
than converting the call sites.

struct cfg80211_ops::remain_on_channel gained a trailing
"const u8 *rx_addr" argument, so cfg80211_rtw_remain_on_channel no
longer matches the callback type.

Both changes are guarded on LINUX_VERSION_CODE >= 7.2.0 and are inactive
on older kernels.

Tested on 7.2.3 (clang 23, ThinLTO) and on 7.0.10 (gcc): both build with
no errors and produce a module with the expected vermagic.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SXU8myb15KhDHtRu8vLHsz
@zukunftsfirmaDE

Copy link
Copy Markdown
Author

@iav did the work already at the same time as myself. Closing my PR.

@CGarces

CGarces commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

Thanks for your PR anyway.

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.

2 participants