Skip to content

Commit

Permalink
tests/gnrc_ipv6_nib: rtr_ltime test
Browse files Browse the repository at this point in the history
  • Loading branch information
xnumad committed Jul 29, 2024
1 parent 41204c8 commit f6b2dfb
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/net/gnrc_ipv6_nib/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,28 @@ static void test_handle_pkt__rtr_adv__success(uint8_t rtr_adv_flags,
TEST_ASSERT_EQUAL_INT(exp_netif.cur_hl,
_mock_netif->cur_hl);
}
{
/*
* > The Router Lifetime applies only to
the router's usefulness as a default router; it
does not apply to information contained in other
message fields or options.
* - https://datatracker.ietf.org/doc/html/rfc4861#section-4.2
* So (after default router list was tested),
* send a RA with Router Lifetime value of zero.
* to test that _handle_rtr_timeout follows this behavior.
* If it doesn't, the following tests for RA options will fail.
*/
icmpv6_len = _set_rtr_adv(&_rem_ll, NDP_HOP_LIMIT, 0U,
false, 0U,
NULL, sizeof(_rem_l2),
0U,
NULL, _LOC_GB_PFX_LEN,
0U);
ndp_rtr_adv_t *rtr_adv = (ndp_rtr_adv_t *)icmpv6;
rtr_adv->ltime = byteorder_htons(0);
gnrc_ipv6_nib_handle_pkt(_mock_netif, ipv6, icmpv6, icmpv6_len);
}
state = NULL;
if (sl2ao) {
TEST_ASSERT_MESSAGE(gnrc_ipv6_nib_nc_iter(0, &state, &nce),
Expand Down

0 comments on commit f6b2dfb

Please sign in to comment.