@@ -1117,6 +1117,17 @@ pub enum ControlMessage<'a> {
11171117 #[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
11181118 Ipv6PacketInfo ( & ' a libc:: in6_pktinfo) ,
11191119
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+
11201131 /// SO_RXQ_OVFL indicates that an unsigned 32 bit value
11211132 /// ancilliary msg (cmsg) should be attached to recieved
11221133 /// skbs indicating the number of packets dropped by the
@@ -1226,6 +1237,10 @@ impl<'a> ControlMessage<'a> {
12261237 target_os = "android" , target_os = "ios" , ) ) ]
12271238 #[ cfg( feature = "net" ) ]
12281239 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 ,
12291244 #[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
12301245 ControlMessage :: RxqOvfl ( drop_count) => {
12311246 drop_count as * const _ as * const u8
@@ -1285,6 +1300,10 @@ impl<'a> ControlMessage<'a> {
12851300 target_os = "android" , target_os = "ios" , ) ) ]
12861301 #[ cfg( feature = "net" ) ]
12871302 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) ,
12881307 #[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
12891308 ControlMessage :: RxqOvfl ( drop_count) => {
12901309 mem:: size_of_val( drop_count)
@@ -1320,6 +1339,10 @@ impl<'a> ControlMessage<'a> {
13201339 target_os = "android" , target_os = "ios" , ) ) ]
13211340 #[ cfg( feature = "net" ) ]
13221341 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 ,
13231346 #[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
13241347 ControlMessage :: RxqOvfl ( _) => libc:: SOL_SOCKET ,
13251348 #[ cfg( target_os = "linux" ) ]
@@ -1362,6 +1385,10 @@ impl<'a> ControlMessage<'a> {
13621385 target_os = "android" , target_os = "ios" , ) ) ]
13631386 #[ cfg( feature = "net" ) ]
13641387 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 ,
13651392 #[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
13661393 ControlMessage :: RxqOvfl ( _) => {
13671394 libc:: SO_RXQ_OVFL
0 commit comments