@@ -330,6 +330,11 @@ impl InetAddr {
330
330
match * std {
331
331
net:: SocketAddr :: V4 ( ref addr) => {
332
332
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 ,
333
338
sin_family: AddressFamily :: Inet as sa_family_t,
334
339
sin_port: addr. port( ) . to_be( ) , // network byte order
335
340
sin_addr: Ipv4Addr :: from_std( addr. ip( ) ) . 0 ,
@@ -338,6 +343,11 @@ impl InetAddr {
338
343
}
339
344
net:: SocketAddr :: V6 ( ref addr) => {
340
345
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 ,
341
351
sin6_family: AddressFamily :: Inet6 as sa_family_t,
342
352
sin6_port: addr. port( ) . to_be( ) , // network byte order
343
353
sin6_addr: Ipv6Addr :: from_std( addr. ip( ) ) . 0 ,
0 commit comments