Closed as not planned
Description
Proposal
Problem statement
Adding a separated set_route
call from the existing set_mark
.
Motivating examples or use cases
set_mark
is more appropriate to assign an ID to a socket that a route can use, whereas set_route
would set the route ID the socket is going to be bound to. The actual set_mark
alone conflates a bit the two notions, thus adding FreeBSD's SO_SETFIB and OpenBSD's SO_RTABLE ought to migrate to the new call whereas Linux' SO_MARK (which the set_mark's idea generates from) and FreeBSD's SO_USER_COOKIE should remain.
Solution sketch
#[cfg(any(target_os("openbsd"), target_os("freebsd")))] pub fn set_route(&self, route: i32) -> io::Result<()> { ... <setsockopt with the platform specific constant> }
Alternatives
Links and related work
ref PR.