From: Ben Pfaff Date: Fri, 9 Dec 2011 21:09:23 +0000 (-0800) Subject: lacp: Avoid valgrind warning in lacp_configure() if custom timing not used. X-Git-Tag: sliver-openvswitch-0.1-1~570 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=2204c61a4f85b14685f6dca6bbfac8adac6e2810;p=sliver-openvswitch.git 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. --- diff --git a/lib/lacp.c b/lib/lacp.c index 2b7799612..edf7f6792 100644 --- a/lib/lacp.c +++ b/lib/lacp.c @@ -243,7 +243,9 @@ lacp_configure(struct lacp *lacp, const struct lacp_settings *s) lacp->active = s->active; lacp->lacp_time = s->lacp_time; - lacp->custom_time = MAX(TIME_UPDATE_INTERVAL, s->custom_time); + lacp->custom_time = (s->lacp_time == LACP_TIME_CUSTOM + ? MAX(TIME_UPDATE_INTERVAL, s->custom_time) + : 0); } /* Returns true if 'lacp' is configured in active mode, false if 'lacp' is