Skip to content

Graceful handling of errors when reading SO_ORIGINAL_DST option#44378

Open
yanavlasov wants to merge 1 commit intoenvoyproxy:mainfrom
yanavlasov:address-from-socket
Open

Graceful handling of errors when reading SO_ORIGINAL_DST option#44378
yanavlasov wants to merge 1 commit intoenvoyproxy:mainfrom
yanavlasov:address-from-socket

Conversation

@yanavlasov
Copy link
Copy Markdown
Contributor

Remove possibility of hard crash when SO_ORIGINAL_DST returns an invalid address. Such errors have not been observed in production and the change is purely defensive.

Risk Level: low
Testing: unit tests
Docs Changes: no
Release Notes: no
Platform Specific Features: Linux only

Signed-off-by: Yan Avlasov <yavlasov@google.com>
@yanavlasov
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request improves the robustness of the network utility by replacing a potentially crashing call to addressFromSockAddrOrDie with a safer addressFromSockAddr call in getOriginalDst. It includes error logging and returns nullptr upon failure, accompanied by a new test case for invalid address families. The review feedback suggests using the actual address length for better validation during the address conversion process.

@yanavlasov yanavlasov enabled auto-merge (squash) April 10, 2026 17:27
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