Skip to content

fix(utils): normalize IPv4 representations before integer conversion - #11954

Open
embrace897 wants to merge 1 commit into
deepflowio:mainfrom
embrace897:codex/main-ipv4-normalize
Open

embrace897 wants to merge 1 commit into
deepflowio:mainfrom
embrace897:codex/main-ipv4-normalize

Conversation

@embrace897

Copy link
Copy Markdown

IpToUint32 currently returns zero for the 16-byte IPv4 representation returned by net.ParseIP. Normalize with To4 before converting, while preserving zero for invalid inputs and native IPv6.

Validation: the isolated production-function harness fails on the original implementation and passes after the patch. Tests cover three IPv4 representations, nil, native IPv6 and malformed input. Full utils package validation is blocked by missing local dependencies; server and eBPF validation were not run. Production reachability has not been established.

Prepared with AI assistance.

This branch has not been deployed

No deployments
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.

1 participant