Age | Commit message (Collapse) | Author |
|
|
|
1303: Renable the ScmTimestamp test on FreeBSD i386 r=posborne a=asomers
The relevant bug was fixed in 11.3-RELEASE
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222039
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
Fix deprecation warning from libc update.
|
|
The relevant bug was fixed in 11.3-RELEASE
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=222039
|
|
Currently the SockProtocol enum is rather scarce. This commit adds the Netlink protocols
defined in netlink(7) to the SockProtocol enum allowing us to use the Nix socket library for
more indepth Netlink work
|
|
The commit https://github.com/nix-rust/nix/pull/1222 added the very
useful Ipv4PktInfo to allow `sendmsg` to define the origin of the ip.
Unfortunattely, it didn't add the struct to Android target devices as
well. This commit adds the `target_os = "android"` checks on the same
place to allow the compilation to work for the following archs tested:
- `cross build --target aarch64-linux-android`
- `cross build --target x86_64-linux-android`
- `cross build --target armv7-linux-androideabi`
Also introduces iOS to allow using on libs for those platforms
|
|
It was only marked unsafe because it did a pointer cast, but that
particular pointer cast is always allowed by C.
|
|
|
|
It already fully validated its arguments, so there's no need for it to
be `unsafe`.
|
|
This adds Ipv4PacketInfo and Ipv6PacketInfo to ControlMessage,
allowing these to be used with sendmsg/sendmmsg.
This change contains the following squashed commits:
Add Ipv{4,6}PacketInfo to ControlMessage.
Add documentation links to Ipv{4,6}PacketInfo
Add changelog entry for Ipv{4,6}PacketInfo
Add link to PR in the Changelog.
Add extra build environments.
Add tests for Ipv{4,6}PacketInfo.
Swap #[test] and #[cfg]
The CI appears to be running the test, even though it's not cfg'd for
that platform. I _think_ this might be due to these being in the wrong
order. So lets try swapping them.
s/freebsd/netbsd/ for Ipv4PacketInfo
netbsd supports in_pktinfo, not freebsd.
Fix the cfg for Ipv{4,6}PacketInfo usage.
Ah, I see what I did wrong. I had fixed the definitions, but I had the
wrong cfg() in the usage. This has the usage match the definitions.
Change SOL_IPV6 to IPPROTO_IPV6.
FreeBSD doesn't have SOL_IPV6, but does have IPPROTO_IPV6, and the two
constants are defined as being equal. So change to use IPPROTO_IPV6.
Skip Ipv6PacketInfo test if v6 is not available.
If IPv6 is not available, then when we try and bind to ip6-localhost,
we'll get a EADDRNOTAVAIL, so skip the test.
This should mean that the test will run on any machine that has a v6
loopback address.
More architecture cfg() fixes.
These all need to be the same, and they were not. Make them them all
the same. Attempt III.
Fix up mismatched cfg's again.
Take IV. Make sure the cfg's that use a enum variant match the enum
definition.
|
|
|
|
sendmmsg() / recvmmsg() in #1208.
In #1208, sendmmsg() / recvmmsg() were added, but OpenBSD(who doesn't support these)
was included on the list of allowed operating systems for sendmmsg() related things.
This broke the build on OpenBSD.
For more Rust-world examples, see: https://github.com/rust-lang/libc/commit/6f6297301d49ff67b8ca044d651f36a56950298c
|
|
repr(transparent) is required in order to safely cast between an FFI
type and its NewType. This commit applies that attribute to PollFd,
EpollEvent, IpMembershipRequest, Ipv6MembershipRequest, TimeVal, and
IoVec.
Fixes #1241
|
|
This is available only on Linux as far I know,
[socket(7)](https://linux.die.net/man/7/socket) has some information
about the `SO_BINDTODEVICE` sockopt. In simple words it binds a socket
to an specific network device (specified as an string like "wlo1",
"eth0", etc.), to only process packets from that device.
Signed-off-by: Jean Pierre Dudey <jeandudey@hotmail.com>
|
|
|
|
1215: Remove sys::socket::addr::from_libc_sockaddr from the public API r=posborne a=asomers
This function never should've been public, since it's basically
impossible to use directly. It's only public due to an oversight from
PR #667 .
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
|
|
|
|
|
|
1206: Fix unaligned casting of cmsg data to af_alg_iv r=asomers a=glebpom
Casting a pointer to `cmsg_data` to `af_alg_iv` is incorrect since it's not properly aligned. As of the [`cmsg` man page](http://man7.org/linux/man-pages/man3/cmsg.3.html) "Applications should not cast it to a pointer type matching the payload, but should instead use memcpy(3) to copy data to or from a suitably declared object."
Co-authored-by: Gleb Pomykalov <gleb@lancastr.com>
|
|
This function never should've been public, since it's basically
impossible to use directly. It's only public due to an oversight from
PR #667 .
|
|
The old code tried to zero-initialize an enum for which 0 is not a valid
value. That worked for older compilers, but triggers a panic with Rust
1.44.0. The correct technique is to use mem::MaybeUninit.
Fixes #1212
|
|
|
|
|
|
This eliminates one of the last remaining uninitialized memory accesses
in Nix.
Fixes #1142
|
|
recvfrom(2) only returns the sender's address for protocols that provide
it. Usually, that means it returns the sender's address for datagram
sockets but not for stream sockets.
Fixes #1144
|
|
Because of the use of MaybeUninit::uninit, the padding fields in msghdr,
which only present on musl builds, are not initialized. Causing garbage
data to be sent to the kernel. This change ensures the paddings are
always zeroed.
|
|
`assert_eq!` gives more debug info when the test fails by default than
`assert!`. This should help make debugging easier.
|
|
1120: Fix length of abstract socket address r=asomers a=yshui
NULL bytes have no special significance in an abstrace address, and the
length of the address is solely decided by the length member. If the
length is set to sun_path.len(), all the NULL bytes will be considered
part of the address.
Tests are updated accordingly.
Closes #1119
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Co-authored-by: Yuxuan Shui <yshuiv7@gmail.com>
|
|
NULL bytes have no special significance in an abstrace address, and the
length of the address is solely decided by the length member. If the
length is set to sun_path.len(), all the NULL bytes will be considered
part of the address.
Tests are updated accordingly.
Closes #1119
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
|
|
Only two instances remain:
* For the deprecated sys::socket::CmsgSpace::new. We should probably
just remove that method.
* For sys::termios::Termios::default_uninit. This will require some
more thought.
Fixes #1096
|
|
|
|
It was leftover from internal churn during PR #1020.
|
|
|
|
|
|
|
|
1095: Fix warnings on Rust 1.37.0 r=asomers a=asomers
* Replace obsolete range syntax "..." with inclusive range "..="
* Use dyn Trait syntax instead of Box<Trait>
* Raise MSRV to 1.27.0 (for dyn Trait syntax)
* Test with nightly again
Co-authored-by: Alan Somers <asomers@gmail.com>
|
|
* Replace obsolete range syntax "..." with inclusive range "..="
* Use dyn Trait syntax instead of Box<Trait>
* Raise MSRV to 1.27.0 (for dyn Trait syntax)
* Raise MSRV to 1.31.0 (because of rand)
tempfile pulls in rand, and rand pulls in fuchsia-cprng, which requires
1.31.0. Why rand pulls in fuchsia-cprng I don't know. It's specified
as a target-specific dependency, but Cargo tries to build it anyway
(only on Linux, not on FreeBSD or OSX). A bug in Cargo 1.27.0?
|
|
This patch adds AF_VSOCK support to AddressFamily in order to use
VSOCK socket.
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
|
|
Abstract paths should always be N-1 in length where N is the length of
the `sun_path` field (first byte is \0). Given that,
`UnixAddr::new_abstract()` should always return this N-1 length, not
just the length of the string provided (the rest of the array will be
\0s).
|
|
Derive Clone, Copy, Eq, Hash, and PartialEq for all types. Not all
traits are supported by all types, which is why many are missing
some.
|
|
MSG_WAITALL can be useful with recv() to wait the full amount of data
requested.
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
|
|
It's not sufficient to check for root privileges. In a container, the
euid may be root even though the user lacks some capabilities. Replace
this test's root check with a check for the CAP_NET_ADMIN capability
instead.
|
|
|
|
|
|
|
|
received using recvmsg.
|
|
|
|
|
|
This was an oversight from PR #1002
|