Context: rust-lang/rust#78802 and https://www.reddit.com/r/rust/comments/wcw93o/a_major_refactor_of_rusts_ip_address/
These lines caught my eye while I was reading the code:
|
// Leans on the fact that SocketAddrV4 and SocketAddrV6 are |
|
// transparent wrappers around SOCKADDR. |
|
// Leans on the fact that SocketAddrV4 and SocketAddrV6 are |
|
// transparent wrappers around sockaddr_in and sockaddr_in6. |
A lot of crates were recently patched to remove the assumption of the memory layout of network primitives. Any code continuing to do so will result in UB, so I wanted to raise this issue.
Context: rust-lang/rust#78802 and https://www.reddit.com/r/rust/comments/wcw93o/a_major_refactor_of_rusts_ip_address/
These lines caught my eye while I was reading the code:
netif/src/lib.rs
Lines 189 to 190 in 550ec42
netif/src/lib.rs
Lines 331 to 332 in 550ec42
A lot of crates were recently patched to remove the assumption of the memory layout of network primitives. Any code continuing to do so will result in UB, so I wanted to raise this issue.