/// Makes sure that `ipv6_consts::LINK_LOCAL_ADDR` is not assigned to the interface after the
/// DAD resolution time.
Makes sure that `ipv6_consts::LINK_LOCAL_ADDR` is not assigned to the interface after the
DAD resolution time.
Makes sure that ` ipv6_consts :: LINK_LOCAL_ADDR ` is not assigned to the interface after the DAD resolution time .
async fn check_address_failed_dad(iface: &netemul::TestInterface<'_>) {
        // Clocks sometimes jump in infrastructure, which can cause a timer to expire prematurely.
        // Fortunately such jumps are rarely seen in quick succession - if we repeatedly wait for
        // shorter durations we can be reasonably sure that the intended amount of time truly did
        // elapse. It is expected that at most one timer worth of time may be lost.
        const STEP: zx::Duration = zx::Duration::from_millis(10);
        let duration = EXPECTED_DAD_RETRANSMIT_TIMER * EXPECTED_DUP_ADDR_DETECT_TRANSMITS
            + ASYNC_EVENT_NEGATIVE_CHECK_TIMEOUT;
        let iterations =
            (duration + STEP - zx::Duration::from_nanos(1)).into_micros() / STEP.into_micros();
        for _ in 0..iterations {
            let () = fasync::Timer::new(fasync::Time::after(STEP)).await;
        }
        let addr = net::Subnet {
            addr: net::IpAddress::Ipv6(net::Ipv6Address {
                addr: ipv6_consts::LINK_LOCAL_ADDR.ipv6_bytes(),
            }),
            prefix_len: 64,
        };
        assert!(!iface
            .get_addrs()
            .await
            .expect("error getting interfacea addresses")
            .iter()
            .any(|a| a == &addr));
    }
async fn check_address_failed_dad ( iface : & netemul :: TestInterface < ' _ > ) { // Clocks sometimes jump in infrastructure, which can cause a timer to expire prematurely. // Fortunately such jumps are rarely seen in quick succession - if we repeatedly wait for // shorter durations we can be reasonably sure that the intended amount of time truly did // elapse. It is expected that at most one timer worth of time may be lost. const STEP : zx :: Duration = zx :: Duration :: from_millis ( 10 ) ; let duration = EXPECTED_DAD_RETRANSMIT_TIMER * EXPECTED_DUP_ADDR_DETECT_TRANSMITS + ASYNC_EVENT_NEGATIVE_CHECK_TIMEOUT ; let iterations = ( duration + STEP - zx :: Duration :: from_nanos ( 1 ) ) . into_micros ( ) / STEP . into_micros ( ) ; for _ in 0 .. iterations { let ( ) = fasync :: Timer :: new ( fasync :: Time :: after ( STEP ) ) . await ; } let addr = net :: Subnet { addr : net :: IpAddress :: Ipv6 ( net :: Ipv6Address { addr : ipv6_consts :: LINK_LOCAL_ADDR . ipv6_bytes ( ) , } ) , prefix_len : 64 , } ; assert ! ( iface get_addrs ( ) await expect ( " " ) iter ( ) any ( a a addr ) ) ; }
Makes sure that `ipv6_consts::LINK_LOCAL_ADDR` is not assigned to the interface after the
DAD resolution time.
Makes sure that ` ipv6_consts :: LINK_LOCAL_ADDR ` is not assigned to the interface after the DAD resolution time .
iface
&netemul::TestInterface<'_>