@@ -1112,7 +1112,7 @@ pub enum ControlMessage<'a> {
1112
1112
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
1113
1113
UdpGsoSegments ( & ' a u16 ) ,
1114
1114
1115
- /// Configure the sending addressing and interface for v4
1115
+ /// Configure the sending addressing and interface for v4.
1116
1116
///
1117
1117
/// For further information, please refer to the
1118
1118
/// [`ip(7)`](https://man7.org/linux/man-pages/man7/ip.7.html) man page.
@@ -1125,7 +1125,7 @@ pub enum ControlMessage<'a> {
1125
1125
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
1126
1126
Ipv4PacketInfo ( & ' a libc:: in_pktinfo) ,
1127
1127
1128
- /// Configure the sending addressing and interface for v6
1128
+ /// Configure the sending addressing and interface for v6.
1129
1129
///
1130
1130
/// For further information, please refer to the
1131
1131
/// [`ipv6(7)`](https://man7.org/linux/man-pages/man7/ipv6.7.html) man page.
@@ -1150,6 +1150,18 @@ pub enum ControlMessage<'a> {
1150
1150
#[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
1151
1151
Ipv4SendSrcAddr ( & ' a libc:: in_addr) ,
1152
1152
1153
+ /// Configure the hop limit for v6 multicast traffic.
1154
+ ///
1155
+ /// Set the multicast hop limit for this message. The argument is an
1156
+ /// integer between 0 and 255. Other than the default, the value -1 will
1157
+ /// set the hop limit to 1, not the route default. Without this cmsg, UDP
1158
+ /// packets sent with sendmsg have a hop limit of 1 and will not leave the
1159
+ /// local network.
1160
+ /// For further information, please refer to the
1161
+ /// [`ipv6(7)`](https://man7.org/linux/man-pages/man7/ipv6.7.html) man page.
1162
+ #[ cfg( any( target_os = "linux" ) ) ]
1163
+ Ipv6MulticastHopLimit ( & ' a libc:: c_int) ,
1164
+
1153
1165
/// SO_RXQ_OVFL indicates that an unsigned 32 bit value
1154
1166
/// ancilliary msg (cmsg) should be attached to recieved
1155
1167
/// skbs indicating the number of packets dropped by the
@@ -1263,6 +1275,8 @@ impl<'a> ControlMessage<'a> {
1263
1275
target_os = "openbsd" , target_os = "dragonfly" ) ) ]
1264
1276
#[ cfg( feature = "net" ) ]
1265
1277
ControlMessage :: Ipv4SendSrcAddr ( addr) => addr as * const _ as * const u8 ,
1278
+ #[ cfg( any( target_os = "linux" ) ) ]
1279
+ ControlMessage :: Ipv6MulticastHopLimit ( limit) => limit as * const _ as * const u8 ,
1266
1280
#[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
1267
1281
ControlMessage :: RxqOvfl ( drop_count) => {
1268
1282
drop_count as * const _ as * const u8
@@ -1326,6 +1340,10 @@ impl<'a> ControlMessage<'a> {
1326
1340
target_os = "openbsd" , target_os = "dragonfly" ) ) ]
1327
1341
#[ cfg( feature = "net" ) ]
1328
1342
ControlMessage :: Ipv4SendSrcAddr ( addr) => mem:: size_of_val( addr) ,
1343
+ #[ cfg( any( target_os = "linux" ) ) ]
1344
+ ControlMessage :: Ipv6MulticastHopLimit ( limit) => {
1345
+ mem:: size_of_val( limit)
1346
+ } ,
1329
1347
#[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
1330
1348
ControlMessage :: RxqOvfl ( drop_count) => {
1331
1349
mem:: size_of_val( drop_count)
@@ -1365,6 +1383,9 @@ impl<'a> ControlMessage<'a> {
1365
1383
target_os = "openbsd" , target_os = "dragonfly" ) ) ]
1366
1384
#[ cfg( feature = "net" ) ]
1367
1385
ControlMessage :: Ipv4SendSrcAddr ( _) => libc:: IPPROTO_IP ,
1386
+ #[ cfg( any( target_os = "linux" ) ) ]
1387
+ #[ cfg( feature = "net" ) ]
1388
+ ControlMessage :: Ipv6MulticastHopLimit ( _) => libc:: IPPROTO_IPV6 ,
1368
1389
#[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
1369
1390
ControlMessage :: RxqOvfl ( _) => libc:: SOL_SOCKET ,
1370
1391
#[ cfg( target_os = "linux" ) ]
@@ -1411,6 +1432,8 @@ impl<'a> ControlMessage<'a> {
1411
1432
target_os = "openbsd" , target_os = "dragonfly" ) ) ]
1412
1433
#[ cfg( feature = "net" ) ]
1413
1434
ControlMessage :: Ipv4SendSrcAddr ( _) => libc:: IP_SENDSRCADDR ,
1435
+ #[ cfg( any( target_os = "linux" ) ) ]
1436
+ ControlMessage :: Ipv6MulticastHopLimit ( _) => libc:: IPV6_HOPLIMIT ,
1414
1437
#[ cfg( any( target_os = "android" , target_os = "fuchsia" , target_os = "linux" ) ) ]
1415
1438
ControlMessage :: RxqOvfl ( _) => {
1416
1439
libc:: SO_RXQ_OVFL
0 commit comments