Skip to content

Commit

Permalink
Do not setsockopt(2) on AF_UNIX / AF_VSOCK sockets
Browse files Browse the repository at this point in the history
With Linux 6.12, specifically this commit:
torvalds/linux@5b0af62,
one can not call `setsockopt(2)` on non-inet (`AF_INET`/`AF_INET6`)
sockets anymore. As the ttRPC socket can only ever be non-inet, we
should not ever call `setsockopt(2)` here.

Signed-off-by: Moritz Sanft <[email protected]>
  • Loading branch information
msanft committed Jan 16, 2025
1 parent 0610015 commit 599048a
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ fn make_socket(sockaddr: &str) -> Result<(RawFd, Domain, Box<dyn SockaddrLike>)>
pub(crate) fn do_bind(sockaddr: &str) -> Result<(RawFd, Domain)> {
let (fd, domain, sockaddr) = make_socket(sockaddr)?;

setsockopt(fd, sockopt::ReusePort, &true)?;
bind(fd, sockaddr.as_ref()).map_err(err_to_others_err!(e, ""))?;

Ok((fd, domain))
Expand Down

0 comments on commit 599048a

Please sign in to comment.