File tree 1 file changed +21
-2
lines changed
1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,16 @@ impl From<SocketAddrV4> for SockAddr {
216
216
sin_family : AF_INET as sa_family_t ,
217
217
sin_port : addr. port ( ) . to_be ( ) ,
218
218
sin_addr,
219
- ..unsafe { mem:: zeroed ( ) }
219
+ sin_zero : [ 0 ; 8 ] ,
220
+ #[ cfg( any(
221
+ target_os = "dragonfly" ,
222
+ target_os = "freebsd" ,
223
+ target_os = "ios" ,
224
+ target_os = "macos" ,
225
+ target_os = "netbsd" ,
226
+ target_os = "openbsd"
227
+ ) ) ]
228
+ sin_len : 0 ,
220
229
} ;
221
230
SockAddr {
222
231
storage : unsafe { storage. assume_init ( ) } ,
@@ -255,7 +264,17 @@ impl From<SocketAddrV6> for SockAddr {
255
264
sin6_scope_id : addr. scope_id ( ) ,
256
265
#[ cfg( windows) ]
257
266
u,
258
- ..unsafe { mem:: zeroed ( ) }
267
+ #[ cfg( any(
268
+ target_os = "dragonfly" ,
269
+ target_os = "freebsd" ,
270
+ target_os = "ios" ,
271
+ target_os = "macos" ,
272
+ target_os = "netbsd" ,
273
+ target_os = "openbsd"
274
+ ) ) ]
275
+ sin6_len : 0 ,
276
+ #[ cfg( any( target_os = "solaris" , target_os = "illumos" ) ) ]
277
+ __sin6_src_id : 0 ,
259
278
} ;
260
279
SockAddr {
261
280
storage : unsafe { storage. assume_init ( ) } ,
You can’t perform that action at this time.
0 commit comments