From 2d393b1b6d8c8cb131b70714ef5cd2d5d1c446bf Mon Sep 17 00:00:00 2001 From: Matt Muggeridge Date: Tue, 14 May 2024 07:50:51 +1000 Subject: [PATCH] network: IPv6 Compliance: Router Advertisement Processing, Reachable Time [v6LC.2.2.15] (#32792) Previously, RA option fields were being ignored when the Router Lifetime value was zero. Remove this logic to be compliant with RFC4861. Extract from: https://www.ietf.org/rfc/rfc4861.html#section-4.2, p.21, first paragraph: 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. This affected IPv6 Conformance test: v6LC.2.2.15: Router Advertisement Processing, Reachable Time. Fixes #31842. Co-authored-by: Matt Muggeridge --- src/network/networkd-ndisc.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c index 92ff7c71f36..b1451817bcc 100644 --- a/src/network/networkd-ndisc.c +++ b/src/network/networkd-ndisc.c @@ -913,11 +913,6 @@ static int ndisc_router_process_reachable_time(Link *link, sd_ndisc_router *rt) if (!link->network->ndisc_use_reachable_time) return 0; - /* Ignore the reachable time field of the RA header if the lifetime is zero. */ - r = sd_ndisc_router_get_lifetime(rt, NULL); - if (r <= 0) - return r; - r = sd_ndisc_router_get_reachable_time(rt, &reachable_time); if (r < 0) return log_link_warning_errno(link, r, "Failed to get reachable time from RA: %m"); @@ -951,11 +946,6 @@ static int ndisc_router_process_retransmission_time(Link *link, sd_ndisc_router if (!link->network->ndisc_use_retransmission_time) return 0; - /* Ignore the retransmission time field of the RA header if the lifetime is zero. */ - r = sd_ndisc_router_get_lifetime(rt, NULL); - if (r <= 0) - return r; - r = sd_ndisc_router_get_retransmission_time(rt, &retrans_time); if (r < 0) return log_link_warning_errno(link, r, "Failed to get retransmission time from RA: %m"); @@ -989,11 +979,6 @@ static int ndisc_router_process_hop_limit(Link *link, sd_ndisc_router *rt) { if (!link->network->ndisc_use_hop_limit) return 0; - /* Ignore the hop limit field of the RA header if the lifetime is zero. */ - r = sd_ndisc_router_get_lifetime(rt, NULL); - if (r <= 0) - return r; - r = sd_ndisc_router_get_hop_limit(rt, &hop_limit); if (r < 0) return log_link_warning_errno(link, r, "Failed to get hop limit from RA: %m"); @@ -1029,11 +1014,6 @@ static int ndisc_router_process_mtu(Link *link, sd_ndisc_router *rt) { if (!link->network->ndisc_use_mtu) return 0; - /* Ignore the MTU option if the lifetime is zero. */ - r = sd_ndisc_router_get_lifetime(rt, NULL); - if (r <= 0) - return r; - r = sd_ndisc_router_get_mtu(rt, &mtu); if (r == -ENODATA) return 0; @@ -2459,7 +2439,6 @@ int ndisc_stop(Link *link) { return sd_ndisc_stop(link->ndisc); } - void ndisc_flush(Link *link) { assert(link); -- 2.47.3