Skip to content

Conversation

@jlucovsky
Copy link
Contributor

Continuation of #14420

Add a configuration option for outputting shortened IPv6 addresses per RFC-5952

The configuration option:
logging.ipv6-addr-shorten has a default value of no.

When set to yes, IPv6 addresses will be shortened everywhere they are output. E.g., the IPv6 address fe80:0000:0000:0000:020c:29ff:faf2:ab42 will be output as fe80::20c:29ff:faf2:ab42

Link to ticket: https://redmine.openinfosecfoundation.org/issues/7399

Describe changes:

  • Add a configuration variable for choosing shortened IPv6 IP addresses
  • Add Rust logic to create a shortened IPv6 address
  • Document changes and usage.

Updates:

  • Address Clippy issues
  • Renamed Rust function to conform with API-naming standard
  • Eliminated extra copy in Rust function
  • s-v test updates.
  • Removed commented-out line from Rust module; added copyright
  • Misc doc updates.

Provide values to any of the below to override the defaults.

  • To use a Suricata-Verify or Suricata-Update pull request,
    link to the pull request in the respective _BRANCH variable.
  • Leave unused overrides blank or remove.

SV_REPO=
SV_BRANCH=OISF/suricata-verify#2789
SU_REPO=
SU_BRANCH=

Issue: 7399

Use shortened IPv6 addresses in all output when configured.

IPv6 addresses are shortened per RFC5952

By default, IPv6 addresses are never shortened; set
logging.ipv6-addr-shorten=yes to shorten.

Added Rust utility function to create shortened IPv6 address.
Document the configuration variable logging.ipv6-addr-shorten

Issue: 7399
@codecov
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

❌ Patch coverage is 91.66667% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.17%. Comparing base (3d80c7f) to head (2f6a21a).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14426      +/-   ##
==========================================
+ Coverage   84.15%   84.17%   +0.02%     
==========================================
  Files        1014     1015       +1     
  Lines      262460   262496      +36     
==========================================
+ Hits       220869   220965      +96     
+ Misses      41591    41531      -60     
Flag Coverage Δ
fuzzcorpus 63.18% <8.33%> (-0.01%) ⬇️
livemode 18.77% <5.55%> (+0.03%) ⬆️
pcap 44.65% <8.33%> (+0.06%) ⬆️
suricata-verify 64.92% <91.66%> (-0.01%) ⬇️
unittests 59.22% <8.33%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@suricata-qa
Copy link

Information: QA ran without warnings.

Pipeline = 28604

Copy link
Contributor

@jufajardini jufajardini left a comment

Choose a reason for hiding this comment

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

This looks good to me (only the line of code before the copyright note a bit unusual :P )!

(But SV PR seems to be missing the min-version)

@jlucovsky
Copy link
Contributor Author

Continued in #14433

@jlucovsky jlucovsky closed this Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants