Skip to content

fix(fcc): support huawei short response with double sockets#470

Merged
stackia merged 1 commit intomainfrom
codex/huawei-fcc-double-socket
May 6, 2026
Merged

fix(fcc): support huawei short response with double sockets#470
stackia merged 1 commit intomainfrom
codex/huawei-fcc-double-socket

Conversation

@stackia
Copy link
Copy Markdown
Owner

@stackia stackia commented May 6, 2026

Summary

This PR adds Huawei-specific FCC double socket support and handles Huawei short FCC responses that do not include NAT traversal fields.

What changed

  • Add a separate FCC media socket for Huawei while keeping Telecom/ZTE/Fiberhome on the existing single socket path.
  • Bind Huawei FCC sockets as an adjacent pair: media port N, signaling port N + 1.
  • Support Huawei FMT=6/type=2 short responses with 24 bytes by parsing first_seq and bitrate, then waiting for unicast instead of falling back to multicast.
  • Keep full Huawei response NAT traversal behavior, sending NAT packets from the media socket when available.
  • Preserve the existing receive classification path: RTCP packets go to FCC response handling, non-RTCP packets go to unicast media handling.
  • Ignore duplicate redirect responses for both Telecom and Huawei without consuming redirect budget.
  • Expand FCC e2e coverage for Huawei short responses, redirect-to-short responses, Telecom redirect duplicates, and single-socket media behavior when the signal port changes.

Validation

  • git diff --check
  • cmake --build build -j$(getconf _NPROCESSORS_ONLN) | tail -100
  • ./scripts/run-e2e.sh test_fcc.py -p 1 | tail -120

@stackia stackia changed the title [codex] Support Huawei FCC short response with double sockets fix(fcc): support huawei short response with double sockets May 6, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-470.eastasia.1.azurestaticapps.net

@stackia stackia force-pushed the codex/huawei-fcc-double-socket branch from b1c7d97 to ab69002 Compare May 6, 2026 18:52
@stackia stackia marked this pull request as ready for review May 6, 2026 18:53
Copilot AI review requested due to automatic review settings May 6, 2026 18:53
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-470.eastasia.1.azurestaticapps.net

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ab69002775

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/fcc.c
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the FCC (Fast Channel Change) implementation to better support Huawei-specific behaviors by introducing a dedicated Huawei media socket (paired with the signaling socket) and by correctly handling Huawei “short” (24-byte) FCC responses that omit NAT traversal fields.

Changes:

  • Add Huawei-only dual-socket support (adjacent media/signaling UDP ports) while keeping other FCC types on the single-socket path.
  • Update FCC event handling to drain/process packets from either the signaling or media socket.
  • Expand E2E coverage for Huawei short responses and redirect flows, and for Telecom redirect duplicates / signal-port changes.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/stream.c Routes events for both FCC signaling socket and (new) Huawei media socket into FCC handling.
src/fcc.h Extends FCC session state with Huawei media socket/client address fields and updates handler signature.
src/fcc.c Implements dual-socket creation/binding/registration and refactors bind logic into reusable helpers.
src/fcc_telecom.c Ignores duplicate redirect responses without consuming redirect budget.
src/fcc_huawei.c Supports Huawei short (24-byte) responses, improves response logging, and ignores duplicate redirects.
e2e/test_fcc.py Adds E2E tests covering Huawei short responses, redirect→short, and Telecom redirect duplicate handling.
e2e/helpers/mock_fcc.py Enhances MockFCCServer to emit short Huawei responses, redirect responses, and adjusted Huawei unicast send port behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/fcc.c
Comment thread src/fcc.c Outdated
Comment thread e2e/helpers/mock_fcc.py
@stackia stackia force-pushed the codex/huawei-fcc-double-socket branch from ab69002 to e4d101c Compare May 6, 2026 19:01
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Azure Static Web Apps: Your stage site is ready! Visit it here: https://thankful-water-0a297bf00-470.eastasia.1.azurestaticapps.net

@stackia stackia merged commit 873dee7 into main May 6, 2026
5 checks passed
@stackia stackia deleted the codex/huawei-fcc-double-socket branch May 6, 2026 19:04
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