@@ -1117,6 +1117,17 @@ pub enum ControlMessage<'a> {
1117
1117
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
1118
1118
Ipv6PacketInfo ( & ' a libc:: in6_pktinfo) ,
1119
1119
1120
+ /// Configure the IPv4 source address with `IP_SENDSRCADDR`.
1121
+ #[ cfg( any(
1122
+ target_os = "netbsd" ,
1123
+ target_os = "freebsd" ,
1124
+ target_os = "openbsd" ,
1125
+ target_os = "dragonfly" ,
1126
+ ) ) ]
1127
+ #[ cfg( feature = "net" ) ]
1128
+ #[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
1129
+ Ipv4SendSrcAddr ( & ' a libc:: in_addr) ,
1130
+
1120
1131
/// SO_RXQ_OVFL indicates that an unsigned 32 bit value
1121
1132
/// ancilliary msg (cmsg) should be attached to recieved
1122
1133
/// skbs indicating the number of packets dropped by the
@@ -1226,6 +1237,10 @@ impl<'a> ControlMessage<'a> {
1226
1237
target_os = "android" , target_os = "ios" , ) ) ]
1227
1238
#[ cfg( feature = "net" ) ]
1228
1239
ControlMessage :: Ipv6PacketInfo ( info) => info as * const _ as * const u8 ,
1240
+ #[ cfg( any( target_os = "netbsd" , target_os = "freebsd" ,
1241
+ target_os = "openbsd" , target_os = "dragonfly" ) ) ]
1242
+ #[ cfg( feature = "net" ) ]
1243
+ ControlMessage :: Ipv4SendSrcAddr ( addr) => addr as * const _ as * const u8 ,
1229
1244
#[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
1230
1245
ControlMessage :: RxqOvfl ( drop_count) => {
1231
1246
drop_count as * const _ as * const u8
@@ -1285,6 +1300,10 @@ impl<'a> ControlMessage<'a> {
1285
1300
target_os = "android" , target_os = "ios" , ) ) ]
1286
1301
#[ cfg( feature = "net" ) ]
1287
1302
ControlMessage :: Ipv6PacketInfo ( info) => mem:: size_of_val( info) ,
1303
+ #[ cfg( any( target_os = "netbsd" , target_os = "freebsd" ,
1304
+ target_os = "openbsd" , target_os = "dragonfly" ) ) ]
1305
+ #[ cfg( feature = "net" ) ]
1306
+ ControlMessage :: Ipv4SendSrcAddr ( addr) => mem:: size_of_val( addr) ,
1288
1307
#[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
1289
1308
ControlMessage :: RxqOvfl ( drop_count) => {
1290
1309
mem:: size_of_val( drop_count)
@@ -1320,6 +1339,10 @@ impl<'a> ControlMessage<'a> {
1320
1339
target_os = "android" , target_os = "ios" , ) ) ]
1321
1340
#[ cfg( feature = "net" ) ]
1322
1341
ControlMessage :: Ipv6PacketInfo ( _) => libc:: IPPROTO_IPV6 ,
1342
+ #[ cfg( any( target_os = "netbsd" , target_os = "freebsd" ,
1343
+ target_os = "openbsd" , target_os = "dragonfly" ) ) ]
1344
+ #[ cfg( feature = "net" ) ]
1345
+ ControlMessage :: Ipv4SendSrcAddr ( _) => libc:: IPPROTO_IP ,
1323
1346
#[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
1324
1347
ControlMessage :: RxqOvfl ( _) => libc:: SOL_SOCKET ,
1325
1348
#[ cfg( target_os = "linux" ) ]
@@ -1362,6 +1385,10 @@ impl<'a> ControlMessage<'a> {
1362
1385
target_os = "android" , target_os = "ios" , ) ) ]
1363
1386
#[ cfg( feature = "net" ) ]
1364
1387
ControlMessage :: Ipv6PacketInfo ( _) => libc:: IPV6_PKTINFO ,
1388
+ #[ cfg( any( target_os = "netbsd" , target_os = "freebsd" ,
1389
+ target_os = "openbsd" , target_os = "dragonfly" ) ) ]
1390
+ #[ cfg( feature = "net" ) ]
1391
+ ControlMessage :: Ipv4SendSrcAddr ( _) => libc:: IP_SENDSRCADDR ,
1365
1392
#[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
1366
1393
ControlMessage :: RxqOvfl ( _) => {
1367
1394
libc:: SO_RXQ_OVFL
0 commit comments