On Tue, Nov 26, 2024 at 05:48:03AM +0100, Stefano Brivio wrote:
On Tue, 26 Nov 2024 15:22:38 +1100 David Gibson
wrote: On Mon, Nov 25, 2024 at 09:09:05AM +0100, Stefano Brivio wrote:
[...]
@@ -420,9 +420,13 @@ void ndp_timer(const struct ctx *c, const struct timespec *now) interval = min_rtr_adv_interval + random() % (max_rtr_adv_interval - min_rtr_adv_interval);
+ if (!next_ra) + goto first;
I don't think avoiding re-indenting two lines is sufficient reason to introduce yet another goto, though..
+ info("NDP: sending unsolicited RA, next in %llds", (long long)interval);
ndp_ra(c, &in6addr_ll_all_nodes);
+first: next_ra = now->tv_sec + interval; }
At the cost of one additional line (and zero non-blank lines):
Eh.. I'm not really convinced, but close enough that I can't be
bothered arguing it further.
Reviewed-by: David Gibson