summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-12-01 16:17:12 +0100
committerThomas Haller <thaller@redhat.com>2022-12-09 12:49:00 +0100
commitd78e87232d4986816a275aad238699155ffe7eed (patch)
tree01456274bf594b6559684eac5ad9e5189fdeef6f
parenta0425b77c39f25c34b26e22f81af360cff56d500 (diff)
ndisc: fix iterating arrays in calc_pre_expiry_rs_msec()
Fixes: de6d069dcedb ('ndisc: send router solicitations before expiry') (cherry picked from commit 3f04778df291b9e719634dd36c81916cb1971c93)
-rw-r--r--src/core/ndisc/nm-ndisc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/ndisc/nm-ndisc.c b/src/core/ndisc/nm-ndisc.c
index 04b673e51d..9a6038d406 100644
--- a/src/core/ndisc/nm-ndisc.c
+++ b/src/core/ndisc/nm-ndisc.c
@@ -1609,27 +1609,27 @@ calc_pre_expiry_rs_msec(NMNDisc *ndisc)
_calc_pre_expiry_rs_msec_worker(
&expiry_msec,
priv->last_rs_msec,
- g_array_index(rdata->addresses, NMNDiscAddress, 0).expiry_msec);
+ g_array_index(rdata->addresses, NMNDiscAddress, i).expiry_msec);
}
for (i = 0; i < rdata->routes->len; i++) {
_calc_pre_expiry_rs_msec_worker(&expiry_msec,
priv->last_rs_msec,
- g_array_index(rdata->routes, NMNDiscRoute, 0).expiry_msec);
+ g_array_index(rdata->routes, NMNDiscRoute, i).expiry_msec);
}
for (i = 0; i < rdata->dns_servers->len; i++) {
_calc_pre_expiry_rs_msec_worker(
&expiry_msec,
priv->last_rs_msec,
- g_array_index(rdata->dns_servers, NMNDiscDNSServer, 0).expiry_msec);
+ g_array_index(rdata->dns_servers, NMNDiscDNSServer, i).expiry_msec);
}
for (i = 0; i < rdata->dns_domains->len; i++) {
_calc_pre_expiry_rs_msec_worker(
&expiry_msec,
priv->last_rs_msec,
- g_array_index(rdata->dns_domains, NMNDiscDNSDomain, 0).expiry_msec);
+ g_array_index(rdata->dns_domains, NMNDiscDNSDomain, i).expiry_msec);
}
return expiry_msec - solicit_retransmit_time_jitter(NM_NDISC_PRE_EXPIRY_TIME_MSEC);