@@ -330,6 +330,11 @@ impl InetAddr {
330330 match * std {
331331 net:: SocketAddr :: V4 ( ref addr) => {
332332 InetAddr :: V4 ( libc:: sockaddr_in {
333+ #[ cfg( any( target_os = "dragonfly" , target_os = "freebsd" ,
334+ target_os = "haiku" , target_os = "hermit" ,
335+ target_os = "ios" , target_os = "macos" ,
336+ target_os = "netbsd" , target_os = "openbsd" ) ) ]
337+ sin_len: mem:: size_of:: <libc:: sockaddr_in>( ) as u8 ,
333338 sin_family: AddressFamily :: Inet as sa_family_t,
334339 sin_port: addr. port( ) . to_be( ) , // network byte order
335340 sin_addr: Ipv4Addr :: from_std( addr. ip( ) ) . 0 ,
@@ -338,6 +343,11 @@ impl InetAddr {
338343 }
339344 net:: SocketAddr :: V6 ( ref addr) => {
340345 InetAddr :: V6 ( libc:: sockaddr_in6 {
346+ #[ cfg( any( target_os = "dragonfly" , target_os = "freebsd" ,
347+ target_os = "haiku" , target_os = "hermit" ,
348+ target_os = "ios" , target_os = "macos" ,
349+ target_os = "netbsd" , target_os = "openbsd" ) ) ]
350+ sin6_len: mem:: size_of:: <libc:: sockaddr_in6>( ) as u8 ,
341351 sin6_family: AddressFamily :: Inet6 as sa_family_t,
342352 sin6_port: addr. port( ) . to_be( ) , // network byte order
343353 sin6_addr: Ipv6Addr :: from_std( addr. ip( ) ) . 0 ,
0 commit comments