* [PATCH] bridge: Correctly clamp MAX forward_delay when enabling STP
@ 2013-10-15 18:57 Vlad Yasevich
2013-10-15 19:17 ` Veaceslav Falico
2013-10-16 0:56 ` Herbert Xu
0 siblings, 2 replies; 4+ messages in thread
From: Vlad Yasevich @ 2013-10-15 18:57 UTC (permalink / raw)
To: netdev; +Cc: Vlad Yasevich, Herbert Xu, Stephen Hemminger
Commit be4f154d5ef0ca147ab6bcd38857a774133f5450
bridge: Clamp forward_delay when enabling STP
had a typo when attempting to clamp maximum forward delay.
It is possible to set bridge_forward_delay to be higher then
permitted maximum when STP is off. When turning STP on, the
higher then allowed delay has to be clamed down to max value.
CC: Herbert Xu <herbert@gondor.apana.org.au>
CC: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
---
net/bridge/br_stp_if.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
index 108084a..656a6f3 100644
--- a/net/bridge/br_stp_if.c
+++ b/net/bridge/br_stp_if.c
@@ -134,7 +134,7 @@ static void br_stp_start(struct net_bridge *br)
if (br->bridge_forward_delay < BR_MIN_FORWARD_DELAY)
__br_set_forward_delay(br, BR_MIN_FORWARD_DELAY);
- else if (br->bridge_forward_delay < BR_MAX_FORWARD_DELAY)
+ else if (br->bridge_forward_delay > BR_MAX_FORWARD_DELAY)
__br_set_forward_delay(br, BR_MAX_FORWARD_DELAY);
if (r == 0) {
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] bridge: Correctly clamp MAX forward_delay when enabling STP
2013-10-15 18:57 [PATCH] bridge: Correctly clamp MAX forward_delay when enabling STP Vlad Yasevich
@ 2013-10-15 19:17 ` Veaceslav Falico
2013-10-16 0:56 ` Herbert Xu
1 sibling, 0 replies; 4+ messages in thread
From: Veaceslav Falico @ 2013-10-15 19:17 UTC (permalink / raw)
To: Vlad Yasevich; +Cc: netdev, Herbert Xu, Stephen Hemminger
On Tue, Oct 15, 2013 at 02:57:45PM -0400, Vlad Yasevich wrote:
>Commit be4f154d5ef0ca147ab6bcd38857a774133f5450
> bridge: Clamp forward_delay when enabling STP
>had a typo when attempting to clamp maximum forward delay.
>
>It is possible to set bridge_forward_delay to be higher then
>permitted maximum when STP is off. When turning STP on, the
>higher then allowed delay has to be clamed down to max value.
>
>CC: Herbert Xu <herbert@gondor.apana.org.au>
>CC: Stephen Hemminger <shemminger@vyatta.com>
>Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
I think it should also be queued for stable, as it's present there also.
David, mind adding it?
As for the code - great catch!
Reviewed-by: Veaceslav Falico <vfalico@redhat.com>
>---
> net/bridge/br_stp_if.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c
>index 108084a..656a6f3 100644
>--- a/net/bridge/br_stp_if.c
>+++ b/net/bridge/br_stp_if.c
>@@ -134,7 +134,7 @@ static void br_stp_start(struct net_bridge *br)
>
> if (br->bridge_forward_delay < BR_MIN_FORWARD_DELAY)
> __br_set_forward_delay(br, BR_MIN_FORWARD_DELAY);
>- else if (br->bridge_forward_delay < BR_MAX_FORWARD_DELAY)
>+ else if (br->bridge_forward_delay > BR_MAX_FORWARD_DELAY)
> __br_set_forward_delay(br, BR_MAX_FORWARD_DELAY);
>
> if (r == 0) {
>--
>1.8.3.1
>
>--
>To unsubscribe from this list: send the line "unsubscribe netdev" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] bridge: Correctly clamp MAX forward_delay when enabling STP
2013-10-15 18:57 [PATCH] bridge: Correctly clamp MAX forward_delay when enabling STP Vlad Yasevich
2013-10-15 19:17 ` Veaceslav Falico
@ 2013-10-16 0:56 ` Herbert Xu
2013-10-17 20:12 ` David Miller
1 sibling, 1 reply; 4+ messages in thread
From: Herbert Xu @ 2013-10-16 0:56 UTC (permalink / raw)
To: Vlad Yasevich; +Cc: netdev, Stephen Hemminger
On Tue, Oct 15, 2013 at 02:57:45PM -0400, Vlad Yasevich wrote:
> Commit be4f154d5ef0ca147ab6bcd38857a774133f5450
> bridge: Clamp forward_delay when enabling STP
> had a typo when attempting to clamp maximum forward delay.
>
> It is possible to set bridge_forward_delay to be higher then
> permitted maximum when STP is off. When turning STP on, the
> higher then allowed delay has to be clamed down to max value.
>
> CC: Herbert Xu <herbert@gondor.apana.org.au>
> CC: Stephen Hemminger <shemminger@vyatta.com>
> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
Good catch!
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Thanks,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] bridge: Correctly clamp MAX forward_delay when enabling STP
2013-10-16 0:56 ` Herbert Xu
@ 2013-10-17 20:12 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-10-17 20:12 UTC (permalink / raw)
To: herbert; +Cc: vyasevic, netdev, shemminger
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Wed, 16 Oct 2013 08:56:57 +0800
> On Tue, Oct 15, 2013 at 02:57:45PM -0400, Vlad Yasevich wrote:
>> Commit be4f154d5ef0ca147ab6bcd38857a774133f5450
>> bridge: Clamp forward_delay when enabling STP
>> had a typo when attempting to clamp maximum forward delay.
>>
>> It is possible to set bridge_forward_delay to be higher then
>> permitted maximum when STP is off. When turning STP on, the
>> higher then allowed delay has to be clamed down to max value.
>>
>> CC: Herbert Xu <herbert@gondor.apana.org.au>
>> CC: Stephen Hemminger <shemminger@vyatta.com>
>> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
>
> Good catch!
>
> Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-10-17 20:12 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-15 18:57 [PATCH] bridge: Correctly clamp MAX forward_delay when enabling STP Vlad Yasevich
2013-10-15 19:17 ` Veaceslav Falico
2013-10-16 0:56 ` Herbert Xu
2013-10-17 20:12 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).