Skip to content

Commit 779b23c

Browse files
bors[bot]devnexen
andauthored
Merge #2085
2085: Adding new sockopt entries for FreeBSD related to routing r=asomers a=devnexen Co-authored-by: David CARLIER <[email protected]>
2 parents d23b798 + 8e4150e commit 779b23c

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
2121
- Added `SOF_TIMESTAMPING_OPT_ID` and `SOF_TIMESTAMPING_OPT_TSONLY` to `nix::sys::socket::TimestampingFlag`.
2222
([#2048](https://github.com/nix-rust/nix/pull/2048))
2323
- Enabled socket timestamping options on Android. ([#2077](https://github.com/nix-rust/nix/pull/2077))
24+
- Added `SO_SETFIB` and `SO_USER_COOKIE` to `nix::sys::socket::sockopt` for FreeBSD.
25+
([#2085](https://github.com/nix-rust/nix/pull/2085))
2426

2527
### Changed
2628

src/sys/socket/sockopt.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,26 @@ sockopt_impl!(
746746
libc::IP_BINDANY,
747747
bool
748748
);
749+
#[cfg(target_os = "freebsd")]
750+
sockopt_impl!(
751+
/// Set the route table (FIB) for this socket up to the `net.fibs` OID limit
752+
/// (more specific than the setfib command line/call which are process based).
753+
Fib,
754+
SetOnly,
755+
libc::SOL_SOCKET,
756+
libc::SO_SETFIB,
757+
i32
758+
);
759+
#[cfg(target_os = "freebsd")]
760+
sockopt_impl!(
761+
/// Set `so_user_cookie` for this socket allowing network traffic based
762+
/// upon it, similar to Linux's netfilter MARK.
763+
UserCookie,
764+
SetOnly,
765+
libc::SOL_SOCKET,
766+
libc::SO_USER_COOKIE,
767+
u32
768+
);
749769
#[cfg(target_os = "linux")]
750770
sockopt_impl!(
751771
/// Set the mark for each packet sent through this socket (similar to the

0 commit comments

Comments
 (0)