Skip to content

[Cisco][G200] [Srv6] Fix to Extend the IPv4 makeUDPTxPacket API to support ECN#1008

Open
itskittycisco wants to merge 1 commit intofacebook:mainfrom
itskittycisco:srv6_ipv4_ecn_dscp
Open

[Cisco][G200] [Srv6] Fix to Extend the IPv4 makeUDPTxPacket API to support ECN#1008
itskittycisco wants to merge 1 commit intofacebook:mainfrom
itskittycisco:srv6_ipv4_ecn_dscp

Conversation

@itskittycisco
Copy link

Pre-submission checklist

  • I've ran the linters locally and fixed lint errors related to the files I modified in this PR. You can install the linters by running pip install -r requirements-dev.txt && pre-commit install
  • pre-commit run
    clang-format.............................................................Passed
    shellcheck...........................................(no files to check)Skipped
    shfmt................................................(no files to check)Skipped
    trim trailing whitespace.................................................Passed
    fix end of files.........................................................Passed
    check yaml...........................................(no files to check)Skipped
    check json...........................................(no files to check)Skipped
    check for merge conflicts................................................Passed
    ruff check...........................................(no files to check)Skipped
    ruff format..........................................(no files to check)Skipped

Summary

For SRv6 encapsulation in UNIFORM mode, inner IPv4 packets must carry both DSCP and ECN so they can be copied to the outer IPv6 header. The IPv4 makeUDPTxPacket API only set DSCP and never set ECN, so ECN was always 0 in inner IPv4 packets.
Solution:
Add an ecn parameter to the IPv4 makeUDPTxPacket overload.
In the generic makeUDPTxPacket(folly::IPAddress, ...) path, split the full ToS byte into DSCP and ECN when building IPv4 packets.
Update SRv6 encap tests to assert ECN and DSCP propagation in the outer header.

Test Plan

@itskittycisco itskittycisco requested a review from a team as a code owner March 17, 2026 02:15
@meta-cla meta-cla bot added the CLA Signed label Mar 17, 2026
@github-actions github-actions bot added the cisco label Mar 17, 2026
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.

1 participant