File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ Added ` Ipv6MulticastHops ` as socket option to set and read.
Original file line number Diff line number Diff line change @@ -355,6 +355,17 @@ sockopt_impl!(
355355 u8
356356) ;
357357#[ cfg( feature = "net" ) ]
358+ sockopt_impl ! (
359+ #[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
360+ /// Set or read the hop limit value of outgoing IPv6 multicast packets for
361+ /// this socket.
362+ Ipv6MulticastHops ,
363+ Both ,
364+ libc:: IPPROTO_IPV6 ,
365+ libc:: IPV6_MULTICAST_HOPS ,
366+ libc:: c_int
367+ ) ;
368+ #[ cfg( feature = "net" ) ]
358369sockopt_impl ! (
359370 #[ cfg_attr( docsrs, doc( cfg( feature = "net" ) ) ) ]
360371 /// Set or read a boolean integer argument that determines whether sent
Original file line number Diff line number Diff line change @@ -325,6 +325,19 @@ fn test_ttl_opts() {
325325 . expect ( "setting ipv6ttl on an inet6 socket should succeed" ) ;
326326}
327327
328+ #[ test]
329+ fn test_ipv6_multicast_hops ( ) {
330+ let fd6 = socket (
331+ AddressFamily :: Inet6 ,
332+ SockType :: Datagram ,
333+ SockFlag :: empty ( ) ,
334+ None ,
335+ )
336+ . unwrap ( ) ;
337+ setsockopt ( & fd6, sockopt:: Ipv6MulticastHops , & 7 )
338+ . expect ( "setting ipv6multicasthops on an inet6 socket should succeed" ) ;
339+ }
340+
328341#[ test]
329342#[ cfg( apple_targets) ]
330343fn test_dontfrag_opts ( ) {
You can’t perform that action at this time.
0 commit comments