-
Notifications
You must be signed in to change notification settings - Fork 681
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no .as_unix_addr() / .as_unix_addr_mut() on SockaddrStorage #1800
Comments
That's deliberate. Such a method could be implemented on the BSDs. But Linux doesn't have a |
Fixed by #1871 . We had to add a |
vandry
added a commit
to vandry/erbium
that referenced
this issue
Dec 28, 2023
Under linux, sockaddr_un does not have a length field, but the nix Rust wrapper for it does keep track of the length, and this must be managed correctly or else UnixAddr::path() will return strings that are too long. Without this change I get either: Error: Failed to listen on /var/lib/erbium/control<binary garbage>: path must be shorter than libc::sockaddr_un.sun_path or Error: Failed to cleanup /var/lib/erbium/control: file name contained an unexpected NUL byte Prior to the resolution of nix-rust/nix#1800 passing the maximum size of a sockaddr_un path was probably the right thing to do, but now it seems it is no longer correct, and furthermore there is now a .as_unix_addr() method on SockaddrStorage.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As above, there's no
.as_unix_addr()
/.as_unix_addr_mut()
methods on SockaddrStorage.Comparing the list from https://docs.rs/nix/latest/nix/sys/socket/trait.SockaddrLike.html#implementors to https://docs.rs/nix/latest/nix/sys/socket/union.SockaddrStorage.html#implementations :
The text was updated successfully, but these errors were encountered: