mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-17 18:43:50 +01:00
gnrc_ipv6_nib: Ignore PIO with on-link flag
This commit is contained in:
parent
d83ec632e3
commit
23d3ccde6b
@ -1621,7 +1621,9 @@ static uint32_t _handle_pio(gnrc_netif_t *netif, const icmpv6_hdr_t *icmpv6,
|
||||
valid_ltime = byteorder_ntohl(pio->valid_ltime);
|
||||
pref_ltime = byteorder_ntohl(pio->pref_ltime);
|
||||
if ((pio->len != NDP_OPT_PI_LEN) || (icmpv6->type != ICMPV6_RTR_ADV) ||
|
||||
ipv6_addr_is_link_local(&pio->prefix) || (valid_ltime < pref_ltime)) {
|
||||
ipv6_addr_is_link_local(&pio->prefix) || (valid_ltime < pref_ltime) ||
|
||||
/* https://datatracker.ietf.org/doc/html/rfc6775#section-5.4 */
|
||||
(gnrc_netif_is_6ln(netif) && (pio->flags & NDP_OPT_PI_FLAGS_L))) {
|
||||
DEBUG("nib: ignoring PIO with invalid data\n");
|
||||
return UINT32_MAX;
|
||||
}
|
||||
|
||||
@ -1056,6 +1056,12 @@ static void test_handle_pkt__rtr_adv__success(uint8_t rtr_adv_flags,
|
||||
TEST_ASSERT_EQUAL_INT(exp_netif.mtu, _mock_netif->ipv6.mtu);
|
||||
}
|
||||
state = NULL;
|
||||
if (pio_flags & NDP_OPT_PI_FLAGS_L) {
|
||||
pio = false;
|
||||
/* Should the host erroneously receive a PIO with the L (on-link) flag set,
|
||||
* then that PIO MUST be ignored.
|
||||
* - https://datatracker.ietf.org/doc/html/rfc6775#section-5.4 */
|
||||
}
|
||||
if (pio) {
|
||||
if (pio_flags & NDP_OPT_PI_FLAGS_A) {
|
||||
TEST_ASSERT_MESSAGE(gnrc_netif_ipv6_addr_idx(_mock_netif,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user