Skip to content
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

Prepare release 0.26.2 #1974

Merged
merged 4 commits into from
Jan 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ task:
- if [ -z "$NOHACK" ]; then cargo hack check --each-feature --target i686-unknown-freebsd; fi
before_cache_script: rm -rf $CARGO_HOME/registry/index

# Test macOS x86_64 in a full VM
# Test macOS aarch64 in a full VM
task:
name: macOS x86_64
name: macOS aarch64
env:
TARGET: x86_64-apple-darwin
osx_instance:
image: big-sur-xcode
TARGET: aarch64-apple-darwin
macos_instance:
image: ghcr.io/cirruslabs/macos-ventura-base:latest
setup_script:
- curl --proto '=https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs
- sh rustup.sh -y --profile=minimal --default-toolchain $TOOLCHAIN
Expand Down Expand Up @@ -235,9 +235,9 @@ task:
- name: Linux x32
env:
TARGET: x86_64-unknown-linux-gnux32
- name: macOS aarch64
- name: macOS x86_64
env:
TARGET: aarch64-apple-darwin
TARGET: x86_64-apple-darwin
- name: NetBSD x86_64
env:
TARGET: x86_64-unknown-netbsd
Expand Down
9 changes: 5 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased] - ReleaseDate
### Fixed
- Fix `SockaddrIn6` bug that was swapping flowinfo and scope_id byte ordering.
([#1964](https://github.com/nix-rust/nix/pull/1964))

## [0.26.1] - 2022-11-29
### Added
### Changed
### Fixed
- Fix UB with `sys::socket::sockopt::SockType` using `SOCK_PACKET`.
([#1821](https://github.com/nix-rust/nix/pull/1821))

### Removed

## [0.26.0] - 2022-11-29
### Added

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ limitations. Support for platforms is split into three tiers:
The following targets are supported by `nix`:

Tier 1:
* aarch64-apple-darwin
* aarch64-unknown-linux-gnu
* arm-unknown-linux-gnueabi
* armv7-unknown-linux-gnueabihf
Expand All @@ -58,13 +59,11 @@ Tier 1:
* mips64el-unknown-linux-gnuabi64
* mipsel-unknown-linux-gnu
* powerpc64le-unknown-linux-gnu
* x86_64-apple-darwin
* x86_64-unknown-freebsd
* x86_64-unknown-linux-gnu
* x86_64-unknown-linux-musl

Tier 2:
* aarch64-apple-darwin
* aarch64-apple-ios
* aarch64-linux-android
* arm-linux-androideabi
Expand All @@ -75,6 +74,7 @@ Tier 2:
* s390x-unknown-linux-gnu
* x86_64-apple-ios
* x86_64-linux-android
* x86_64-apple-darwin
* x86_64-unknown-illumos
* x86_64-unknown-netbsd

Expand Down
16 changes: 14 additions & 2 deletions src/sys/socket/addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1476,8 +1476,8 @@ impl From<SockaddrIn6> for net::SocketAddrV6 {
net::SocketAddrV6::new(
net::Ipv6Addr::from(addr.0.sin6_addr.s6_addr),
u16::from_be(addr.0.sin6_port),
u32::from_be(addr.0.sin6_flowinfo),
u32::from_be(addr.0.sin6_scope_id),
addr.0.sin6_flowinfo,
addr.0.sin6_scope_id,
)
}
}
Expand Down Expand Up @@ -3167,6 +3167,18 @@ mod tests {
SockaddrIn6::size() as usize
);
}

#[test]
// Ensure that we can convert to-and-from std::net variants without change.
fn to_and_from() {
let s = "[1234:5678:90ab:cdef::1111:2222]:8080";
let mut nix_sin6 = SockaddrIn6::from_str(s).unwrap();
nix_sin6.0.sin6_flowinfo = 0x12345678;
nix_sin6.0.sin6_scope_id = 0x9abcdef0;

let std_sin6 : std::net::SocketAddrV6 = nix_sin6.into();
assert_eq!(nix_sin6, std_sin6.into());
}
}

mod sockaddr_storage {
Expand Down
2 changes: 1 addition & 1 deletion src/sys/socket/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,7 @@ impl<'a> ControlMessage<'a> {
}
#[cfg(any(target_os = "android", target_os = "linux"))]
ControlMessage::AlgSetIv(iv) => {
mem::size_of_val(&iv) + iv.len()
mem::size_of::<&[u8]>() + iv.len()
},
#[cfg(any(target_os = "android", target_os = "linux"))]
ControlMessage::AlgSetOp(op) => {
Expand Down