Skip to content

Commit

Permalink
Add SO_ORIGINAL_DST
Browse files Browse the repository at this point in the history
  • Loading branch information
justinlatimer committed May 2, 2016
1 parent 5fa5fd4 commit 3954580
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
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

0 comments on commit 3954580

Please sign in to comment.