Skip to content
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 SO_ORIGINAL_DST #367

Merged
merged 1 commit into from
May 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/sys/socket/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ mod os {
pub const SO_TIMESTAMP: c_int = 29;
pub const SO_TYPE: c_int = 3;
pub const SO_BUSY_POLL: c_int = 46;
#[cfg(target_os = "linux")]
pub const SO_ORIGINAL_DST: c_int = 80;

// Socket options for TCP sockets
pub const TCP_NODELAY: c_int = 1;
Expand Down
4 changes: 4 additions & 0 deletions src/sys/socket/sockopt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ use super::{ffi, consts, GetSockOpt, SetSockOpt};
use {Errno, Result};
use sys::time::TimeVal;
use libc::{c_int, uint8_t, c_void, socklen_t};
#[cfg(target_os = "linux")]
use libc::sockaddr_in;
use std::mem;
use std::os::unix::io::RawFd;

Expand Down Expand Up @@ -168,6 +170,8 @@ sockopt_impl!(GetOnly, SockType, consts::SOL_SOCKET, consts::SO_TYPE, super::Soc
target_os = "linux",
target_os = "nacl"))]
sockopt_impl!(GetOnly, AcceptConn, consts::SOL_SOCKET, consts::SO_ACCEPTCONN, bool);
#[cfg(target_os = "linux")]
sockopt_impl!(GetOnly, OriginalDst, consts::SOL_IP, consts::SO_ORIGINAL_DST, sockaddr_in);

/*
*
Expand Down