Skip to content

Commit 2204c61

Browse files
committed
lacp: Avoid valgrind warning in lacp_configure() if custom timing not used.
The caller currently doesn't fill in s->custom_time unless it actually wants a custom LACP time, but lacp_configure() still does a calculation with it, provoking a warning from valgrind. This eliminates the warning. The calculated value was not actually used in this case, so this commit does not fix a real bug.
1 parent 3845a3f commit 2204c61

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/lacp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,9 @@ lacp_configure(struct lacp *lacp, const struct lacp_settings *s)
243243

244244
lacp->active = s->active;
245245
lacp->lacp_time = s->lacp_time;
246-
lacp->custom_time = MAX(TIME_UPDATE_INTERVAL, s->custom_time);
246+
lacp->custom_time = (s->lacp_time == LACP_TIME_CUSTOM
247+
? MAX(TIME_UPDATE_INTERVAL, s->custom_time)
248+
: 0);
247249
}
248250

249251
/* Returns true if 'lacp' is configured in active mode, false if 'lacp' is

0 commit comments

Comments
 (0)