Skip to content

[network] add so_mark as a socket option#5352

Merged
zuercher merged 4 commits intoenvoyproxy:masterfrom
klarose:add_so_mark
Dec 22, 2018
Merged

[network] add so_mark as a socket option#5352
zuercher merged 4 commits intoenvoyproxy:masterfrom
klarose:add_so_mark

Conversation

@klarose
Copy link
Copy Markdown
Contributor

@klarose klarose commented Dec 19, 2018

Description: IP Source transparency involves non-local IP addresses being routed as though they were local. This requires some magic in the stack to ensure that those flows are sent back to envoy from the upstream host, rather than back to the original source IP address. We plan on using SO_MARK to do this. So, add it into the socket option factory. My intention is for it to be used by a follow-up PR to #5337.

This was cherry-picked from PR #5035 where it was already reviewed. I plan on closing that PR.

Risk Level: Low. No code invoked in production yet.
Testing: Ran newly added UT and other UT in network.
Docs Changes: None until we expose this through config.
Release Notes: None

We can use this to control whether or not a packet is marked when
emitted by Envoy.

Signed-off-by: Kyle Larose <kyle@agilicus.com>
@klarose
Copy link
Copy Markdown
Contributor Author

klarose commented Dec 19, 2018

Regarding the UT: It's a bit nicer in the original PR, because I had the work from #5351 in it. I'll make that change later as a separate PR, or in this if #5351 gets in quickly enough.

@klarose
Copy link
Copy Markdown
Contributor Author

klarose commented Dec 20, 2018

@zuercher I'd appreciate it you looked over this again (since it's just a chunk of what you've already reviewed. :) )

zuercher
zuercher previously approved these changes Dec 20, 2018
Copy link
Copy Markdown
Member

@zuercher zuercher left a comment

Choose a reason for hiding this comment

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

Looks good to me, modulo maybe adding a comment.

We can simplify the tests in the future. Leave a TODO.

Signed-off-by: Kyle Larose <kyle@agilicus.com>
Signed-off-by: Kyle Larose <kyle@agilicus.com>
zuercher
zuercher previously approved these changes Dec 21, 2018
Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

LGTM w/ small nit

/wait

As requested in review.

Signed-off-by: Kyle Larose <kyle@agilicus.com>
@zuercher zuercher merged commit 3e416aa into envoyproxy:master Dec 22, 2018
fredlas pushed a commit to fredlas/envoy that referenced this pull request Mar 5, 2019
IP Source transparency involves non-local IP addresses being routed as though they were local. This requires some magic in the stack to ensure that those flows are sent back to envoy from the upstream host, rather than back to the original source IP address. We plan on using SO_MARK to do this. So, add it into the socket option factory. My intention is for it to be used by a follow-up PR to envoyproxy#5337.

This was cherry-picked from PR envoyproxy#5035 where it was already reviewed. I plan on closing that PR.

Risk Level: Low. No code invoked in production yet.
Testing: Ran newly added UT and other UT in network.
Docs Changes: None until we expose this through config.
Release Notes: None

Signed-off-by: Kyle Larose <kyle@agilicus.com>
Signed-off-by: Fred Douglas <fredlas@google.com>
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.

3 participants