Skip to content

Commit 013931b

Browse files
bors[bot]aarond10asomersJonathanWoollett-Light
authored
Merge #1974
1974: Prepare release 0.26.2 r=asomers a=asomers Cherry-pick #1964 . Co-authored-by: Aaron Drew <aarond10@gmail.com> Co-authored-by: Alan Somers <asomers@gmail.com> Co-authored-by: Jonathan <jonathanwoollettlight@gmail.com>
2 parents e7a646d + 8aa85bb commit 013931b

File tree

5 files changed

+29
-16
lines changed

5 files changed

+29
-16
lines changed

.cirrus.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ task:
6767
- if [ -z "$NOHACK" ]; then cargo hack check --each-feature --target i686-unknown-freebsd; fi
6868
before_cache_script: rm -rf $CARGO_HOME/registry/index
6969

70-
# Test macOS x86_64 in a full VM
70+
# Test macOS aarch64 in a full VM
7171
task:
72-
name: macOS x86_64
72+
name: macOS aarch64
7373
env:
74-
TARGET: x86_64-apple-darwin
75-
osx_instance:
76-
image: big-sur-xcode
74+
TARGET: aarch64-apple-darwin
75+
macos_instance:
76+
image: ghcr.io/cirruslabs/macos-ventura-base:latest
7777
setup_script:
7878
- curl --proto '=https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs
7979
- sh rustup.sh -y --profile=minimal --default-toolchain $TOOLCHAIN
@@ -235,9 +235,9 @@ task:
235235
- name: Linux x32
236236
env:
237237
TARGET: x86_64-unknown-linux-gnux32
238-
- name: macOS aarch64
238+
- name: macOS x86_64
239239
env:
240-
TARGET: aarch64-apple-darwin
240+
TARGET: x86_64-apple-darwin
241241
- name: NetBSD x86_64
242242
env:
243243
TARGET: x86_64-unknown-netbsd

CHANGELOG.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
All notable changes to this project will be documented in this file.
44
This project adheres to [Semantic Versioning](https://semver.org/).
55

6+
## [Unreleased] - ReleaseDate
7+
### Fixed
8+
- Fix `SockaddrIn6` bug that was swapping flowinfo and scope_id byte ordering.
9+
([#1964](https://github.com/nix-rust/nix/pull/1964))
10+
611
## [0.26.1] - 2022-11-29
7-
### Added
8-
### Changed
912
### Fixed
1013
- Fix UB with `sys::socket::sockopt::SockType` using `SOCK_PACKET`.
1114
([#1821](https://github.com/nix-rust/nix/pull/1821))
1215

13-
### Removed
14-
1516
## [0.26.0] - 2022-11-29
1617
### Added
1718

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ limitations. Support for platforms is split into three tiers:
4747
The following targets are supported by `nix`:
4848

4949
Tier 1:
50+
* aarch64-apple-darwin
5051
* aarch64-unknown-linux-gnu
5152
* arm-unknown-linux-gnueabi
5253
* armv7-unknown-linux-gnueabihf
@@ -58,13 +59,11 @@ Tier 1:
5859
* mips64el-unknown-linux-gnuabi64
5960
* mipsel-unknown-linux-gnu
6061
* powerpc64le-unknown-linux-gnu
61-
* x86_64-apple-darwin
6262
* x86_64-unknown-freebsd
6363
* x86_64-unknown-linux-gnu
6464
* x86_64-unknown-linux-musl
6565

6666
Tier 2:
67-
* aarch64-apple-darwin
6867
* aarch64-apple-ios
6968
* aarch64-linux-android
7069
* arm-linux-androideabi
@@ -75,6 +74,7 @@ Tier 2:
7574
* s390x-unknown-linux-gnu
7675
* x86_64-apple-ios
7776
* x86_64-linux-android
77+
* x86_64-apple-darwin
7878
* x86_64-unknown-illumos
7979
* x86_64-unknown-netbsd
8080

src/sys/socket/addr.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1476,8 +1476,8 @@ impl From<SockaddrIn6> for net::SocketAddrV6 {
14761476
net::SocketAddrV6::new(
14771477
net::Ipv6Addr::from(addr.0.sin6_addr.s6_addr),
14781478
u16::from_be(addr.0.sin6_port),
1479-
u32::from_be(addr.0.sin6_flowinfo),
1480-
u32::from_be(addr.0.sin6_scope_id),
1479+
addr.0.sin6_flowinfo,
1480+
addr.0.sin6_scope_id,
14811481
)
14821482
}
14831483
}
@@ -3167,6 +3167,18 @@ mod tests {
31673167
SockaddrIn6::size() as usize
31683168
);
31693169
}
3170+
3171+
#[test]
3172+
// Ensure that we can convert to-and-from std::net variants without change.
3173+
fn to_and_from() {
3174+
let s = "[1234:5678:90ab:cdef::1111:2222]:8080";
3175+
let mut nix_sin6 = SockaddrIn6::from_str(s).unwrap();
3176+
nix_sin6.0.sin6_flowinfo = 0x12345678;
3177+
nix_sin6.0.sin6_scope_id = 0x9abcdef0;
3178+
3179+
let std_sin6 : std::net::SocketAddrV6 = nix_sin6.into();
3180+
assert_eq!(nix_sin6, std_sin6.into());
3181+
}
31703182
}
31713183

31723184
mod sockaddr_storage {

src/sys/socket/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,7 @@ impl<'a> ControlMessage<'a> {
12981298
}
12991299
#[cfg(any(target_os = "android", target_os = "linux"))]
13001300
ControlMessage::AlgSetIv(iv) => {
1301-
mem::size_of_val(&iv) + iv.len()
1301+
mem::size_of::<&[u8]>() + iv.len()
13021302
},
13031303
#[cfg(any(target_os = "android", target_os = "linux"))]
13041304
ControlMessage::AlgSetOp(op) => {

0 commit comments

Comments
 (0)