Skip to content

Conversation

@graysky2
Copy link
Contributor

@graysky2 graysky2 commented Jan 3, 2026

Update all printk() calls to use appropriate pr_* logging macros to comply with modern kernel coding standards and ensure proper log level semantics across the nat46 module.

Changes:

  • nat46-glue.c: Replace printk with pr_err() for errors and pr_info() for informational messages in instance allocation and release functions

  • nat46-glue.h: Update assert macro to use pr_emerg() instead of printk for critical assertion failures

  • nat46-module.c: Replace all printk(KERN_INFO ...) and printk() calls with pr_info() for informational messages and pr_err() for error conditions in module initialization, proc filesystem operations, and device management functions

  • nat46-netdev.c: Replace printk with pr_err() for error conditions (allocation failures, device operations) and pr_info() for informational messages (device creation, destruction, and debug output)

This ensures consistent logging behavior, improves compatibility with newer kernel versions, and follows kernel development best practices for message severity classification.

graysky2 added a commit to graysky2/openwrt that referenced this pull request Jan 3, 2026
Bump to 2025-11-04 snapshot.

Added 100-gcc15-fix.patch which drops __DATE__/__TIME__ usage and provides
a stable fallback ("unknown"). This fixes build failures with GCC 15 and
-Werror=date-time in kernel builds.

Added 101-Replace-printk-with-pr_-macros-for-kernel-compliance.patch
suggested by github copilot to avoid CI build failures. See header for
details. This has been submitted to merge upstream.[1]

% git log --oneline 04923c5..adb2f72
adb2f72e6fb8 get rid of spurious ubsan complaint for nat46_instance_t pairs field
d5f88686a4a8 Add a test harness which boots the kernel under kvm with a custom init which runs the tests
b983bab221f0 nat46-core: Fix FIXMEs about ICMPv6 parameter pointers
1aca482d6917 Add support for ignoring traffic class or TOS translation at the same time

1. ayourtch/nat46#67

Signed-off-by: John Audia <therealgraysky@proton.me>
@ayourtch
Copy link
Owner

ayourtch commented Jan 3, 2026

@angus19 - this change looks sensible to me. what do you think ?

@angus19
Copy link
Contributor

angus19 commented Jan 5, 2026

@ayourtch LGTM too. Please merge it. Thanks.

@graysky2 graysky2 force-pushed the fix branch 2 times, most recently from 747a32f to c45c9c7 Compare January 8, 2026 10:59
@graysky2
Copy link
Contributor Author

graysky2 commented Jan 8, 2026

Rebase should be good one/single commit.

Update all printk() calls to use appropriate pr_* logging macros
to comply with modern kernel coding standards and ensure proper
log level semantics across the nat46 module.

Changes:
- nat46-glue.c: Replace printk with pr_err() for errors and
  pr_info() for informational messages in instance allocation
  and release functions

- nat46-glue.h: Update assert macro to use pr_emerg() instead
  of printk for critical assertion failures

- nat46-module.c: Replace all printk(KERN_INFO ...) and
  printk() calls with pr_info() for informational messages
  and pr_err() for error conditions in module initialization,
  proc filesystem operations, and device management functions

- nat46-netdev.c: Replace printk with pr_err() for error
  conditions (allocation failures, device operations) and
  pr_info() for informational messages (device creation,
  destruction, and debug output)

This ensures consistent logging behavior, improves compatibility
with newer kernel versions, and follows kernel development best
practices for message severity classification.

Signed-off-by: John Audia <therealgraysky@proton.me>
@ayourtch ayourtch merged commit 42d5da5 into ayourtch:master Jan 8, 2026
1 check 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