mirror of
https://github.com/jiangcuo/nix.git
synced 2026-08-09 14:21:07 +00:00
Merge #2088
2088: sockopt add OpenBSD's SO_RTABLE to set the route table. r=asomers a=devnexen Also SO_ACCEPTFILTER for FreeBSD/NetBSD. Co-authored-by: David Carlier <devnexen@gmail.com> Co-authored-by: David CARLIER <devnexen@gmail.com>
This commit is contained in:
commit
f9d3a224e2
@ -24,6 +24,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
|
||||
- Added vsock support for macOS ([#2056](https://github.com/nix-rust/nix/pull/2056))
|
||||
- Added `SO_SETFIB` and `SO_USER_COOKIE` to `nix::sys::socket::sockopt` for FreeBSD.
|
||||
([#2085](https://github.com/nix-rust/nix/pull/2085))
|
||||
- Added `SO_RTABLE` for OpenBSD and `SO_ACCEPTFILTER` for FreeBSD/NetBSD to `nix::sys::socket::sockopt`.
|
||||
([#2085](https://github.com/nix-rust/nix/pull/2085))
|
||||
|
||||
### Changed
|
||||
|
||||
|
||||
@ -766,6 +766,26 @@ sockopt_impl!(
|
||||
libc::SO_USER_COOKIE,
|
||||
u32
|
||||
);
|
||||
#[cfg(target_os = "openbsd")]
|
||||
sockopt_impl!(
|
||||
/// Set the route table for this socket, needs a privileged user if
|
||||
/// the process/socket had been set to the non default route.
|
||||
Rtable,
|
||||
SetOnly,
|
||||
libc::SOL_SOCKET,
|
||||
libc::SO_RTABLE,
|
||||
i32
|
||||
);
|
||||
#[cfg(any(target_os = "freebsd", target_os = "netbsd"))]
|
||||
sockopt_impl!(
|
||||
/// Get/set a filter on this socket before accepting connections similarly
|
||||
/// to Linux's TCP_DEFER_ACCEPT but after the listen's call.
|
||||
AcceptFilter,
|
||||
Both,
|
||||
libc::SOL_SOCKET,
|
||||
libc::SO_ACCEPTFILTER,
|
||||
libc::accept_filter_arg
|
||||
);
|
||||
#[cfg(target_os = "linux")]
|
||||
sockopt_impl!(
|
||||
/// Set the mark for each packet sent through this socket (similar to the
|
||||
|
||||
Loading…
Reference in New Issue
Block a user