-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for SO_ORIGINAL_DST and IP6T_SO_ORIGINAL_DST. #360
Conversation
Those values contain the original destination IPv4/IPv6 address of the connection redirected using iptables REDIRECT or TPROXY. Signed-off-by: Piotr Sikora <[email protected]>
Could also add a test, even if it's ignored by default. |
Signed-off-by: Piotr Sikora <[email protected]>
Signed-off-by: Piotr Sikora <[email protected]>
Signed-off-by: Piotr Sikora <[email protected]>
Done. |
fn original_dst() { | ||
let socket = Socket::new(Domain::IPV4, Type::STREAM, None).unwrap(); | ||
match socket.original_dst() { | ||
Ok(_) => panic!("original_dst on non-redirected socket should fail"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How difficult would it be to add a test that successfully retrieved the address?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'd need to configure iptables
redirect in the operating system, which seems invasive for a test of the bindings.
Thanks @PiotrSikora. |
Those values contain the original destination IPv4/IPv6 address
of the connection redirected using iptables REDIRECT or TPROXY.
Signed-off-by: Piotr Sikora [email protected]