Skip to content

Commit

Permalink
Merge #2085
Browse files Browse the repository at this point in the history
2085: Adding new sockopt entries for FreeBSD related to routing r=asomers a=devnexen



Co-authored-by: David CARLIER <devnexen@gmail.com>
  • Loading branch information
bors[bot] and devnexen authored Aug 6, 2023
2 parents d23b798 + 8e4150e commit 779b23c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
- Added `SOF_TIMESTAMPING_OPT_ID` and `SOF_TIMESTAMPING_OPT_TSONLY` to `nix::sys::socket::TimestampingFlag`.
([#2048](https://github.com/nix-rust/nix/pull/2048))
- Enabled socket timestamping options on Android. ([#2077](https://github.com/nix-rust/nix/pull/2077))
- Added `SO_SETFIB` and `SO_USER_COOKIE` to `nix::sys::socket::sockopt` for FreeBSD.
([#2085](https://github.com/nix-rust/nix/pull/2085))

### Changed

Expand Down
20 changes: 20 additions & 0 deletions src/sys/socket/sockopt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,26 @@ sockopt_impl!(
libc::IP_BINDANY,
bool
);
#[cfg(target_os = "freebsd")]
sockopt_impl!(
/// Set the route table (FIB) for this socket up to the `net.fibs` OID limit
/// (more specific than the setfib command line/call which are process based).
Fib,
SetOnly,
libc::SOL_SOCKET,
libc::SO_SETFIB,
i32
);
#[cfg(target_os = "freebsd")]
sockopt_impl!(
/// Set `so_user_cookie` for this socket allowing network traffic based
/// upon it, similar to Linux's netfilter MARK.
UserCookie,
SetOnly,
libc::SOL_SOCKET,
libc::SO_USER_COOKIE,
u32
);
#[cfg(target_os = "linux")]
sockopt_impl!(
/// Set the mark for each packet sent through this socket (similar to the
Expand Down

0 comments on commit 779b23c

Please sign in to comment.