]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bridge: Clamp forward_delay when enabling STP
authorHerbert Xu <herbert@gondor.apana.org.au>
Thu, 12 Sep 2013 07:12:05 +0000 (17:12 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Oct 2013 21:51:07 +0000 (14:51 -0700)
commit20218d3d355cb32bdf1d737438958aa75f6ab21a
tree1877629259f8f8adf67036b5ab57dfe827336b72
parentae9f7cfdfc708c1c323e7e02e3ba067ddc96b671
bridge: Clamp forward_delay when enabling STP

[ Upstream commit be4f154d5ef0ca147ab6bcd38857a774133f5450 ]

At some point limits were added to forward_delay.  However, the
limits are only enforced when STP is enabled.  This created a
scenario where you could have a value outside the allowed range
while STP is disabled, which then stuck around even after STP
is enabled.

This patch fixes this by clamping the value when we enable STP.

I had to move the locking around a bit to ensure that there is
no window where someone could insert a value outside the range
while we're in the middle of enabling STP.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/bridge/br_private.h
net/bridge/br_stp.c
net/bridge/br_stp_if.c