Skip to content

output/ipv6: Add configuration option to shorten IPv6 IP addresses#14770

Open
jlucovsky wants to merge 2 commits intoOISF:mainfrom
jlucovsky:7399.v2/9
Open

output/ipv6: Add configuration option to shorten IPv6 IP addresses#14770
jlucovsky wants to merge 2 commits intoOISF:mainfrom
jlucovsky:7399.v2/9

Conversation

@jlucovsky
Copy link
Contributor

Continuation of #14636

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 to 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.
  • Rearranged copyright notice
  • Updated s-v test cases with min-version
  • Formatted with rustfmt
  • Added test cases
  • Changed return for detection of success/failure.
  • Fixed issue handling return value.
  • Rust updates to use MSRV-compatible from
  • Removed mention of ipv6 shorten config from upgrade doc.
  • Addressed review comments; refer to correct config var in commit msg.

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
global.ipv6-addr-shorten=yes to shorten.

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

Issue: 7399
@codecov
Copy link

codecov bot commented Feb 8, 2026

Codecov Report

❌ Patch coverage is 99.22481% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.12%. Comparing base (364d2c0) to head (139035e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #14770      +/-   ##
==========================================
- Coverage   82.15%   82.12%   -0.03%     
==========================================
  Files        1003     1004       +1     
  Lines      263674   263803     +129     
==========================================
+ Hits       216611   216661      +50     
- Misses      47063    47142      +79     
Flag Coverage Δ
fuzzcorpus 60.18% <8.82%> (-0.01%) ⬇️
livemode 18.72% <5.88%> (-0.01%) ⬇️
netns 18.53% <8.82%> (-0.02%) ⬇️
pcap 44.56% <8.82%> (-0.07%) ⬇️
suricata-verify 65.01% <94.11%> (-0.45%) ⬇️
unittests 59.24% <95.34%> (+0.01%) ⬆️

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 = 29489

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.

2 participants