From d7a951b947c84c94f064b763408f1bc81da9d2fd Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 28 Jan 2022 18:48:13 +0100 Subject: [PATCH] l3cfg: add comment to _acd_data_collect_tracks_data() about linear search --- src/core/nm-l3cfg.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/core/nm-l3cfg.c b/src/core/nm-l3cfg.c index fc3b427894..1ac477275d 100644 --- a/src/core/nm-l3cfg.c +++ b/src/core/nm-l3cfg.c @@ -1334,6 +1334,15 @@ _acd_data_collect_tracks_data(const AcdData *acd_data, guint n = 0; guint i; + /* We do a simple search over all track-infos for the best, which determines + * our ACD state. That is, we prefer ACD disabled, and otherwise the + * shortest configured timeout. + * + * This linear search is probably fast enough, because we expect that each + * address/acd_data has few trackers. + * The alternative would be caching the best result, but that is more complicated, + * so not done. */ + for (i = 0; i < acd_data->info.n_track_infos; i++) { const NML3AcdAddrTrackInfo *acd_track = &acd_data->info.track_infos[i];