File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 3
3
All notable changes to this project will be documented in this file.
4
4
This project adheres to [ Semantic Versioning] ( https://semver.org/ ) .
5
5
6
+ ## [ Unreleased] - ReleaseDate
7
+ ### Added
8
+ ### Changed
9
+ ### Fixed
10
+ - Fix ` SockaddrIn6 ` bug that was swapping flowinfo and scope_id byte ordering.
11
+ ([ #1964 ] ( https://github.com/nix-rust/nix/pull/1964 ) )
12
+
13
+ ### Removed
14
+
6
15
## [ 0.26.1] - 2022-11-29
7
16
### Added
8
17
### Changed
Original file line number Diff line number Diff line change @@ -1476,8 +1476,8 @@ impl From<SockaddrIn6> for net::SocketAddrV6 {
1476
1476
net:: SocketAddrV6 :: new (
1477
1477
net:: Ipv6Addr :: from ( addr. 0 . sin6_addr . s6_addr ) ,
1478
1478
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 ,
1481
1481
)
1482
1482
}
1483
1483
}
@@ -3167,6 +3167,18 @@ mod tests {
3167
3167
SockaddrIn6 :: size( ) as usize
3168
3168
) ;
3169
3169
}
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
+ }
3170
3182
}
3171
3183
3172
3184
mod sockaddr_storage {
You can’t perform that action at this time.
0 commit comments