diff options
Diffstat (limited to 'net/bridge/br_stp.c')
-rw-r--r-- | net/bridge/br_stp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c index dd147d78a588..8c836d96ba76 100644 --- a/net/bridge/br_stp.c +++ b/net/bridge/br_stp.c | |||
@@ -17,9 +17,9 @@ | |||
17 | #include "br_private_stp.h" | 17 | #include "br_private_stp.h" |
18 | 18 | ||
19 | /* since time values in bpdu are in jiffies and then scaled (1/256) | 19 | /* since time values in bpdu are in jiffies and then scaled (1/256) |
20 | * before sending, make sure that is at least one. | 20 | * before sending, make sure that is at least one STP tick. |
21 | */ | 21 | */ |
22 | #define MESSAGE_AGE_INCR ((HZ < 256) ? 1 : (HZ/256)) | 22 | #define MESSAGE_AGE_INCR ((HZ / 256) + 1) |
23 | 23 | ||
24 | static const char *const br_port_state_names[] = { | 24 | static const char *const br_port_state_names[] = { |
25 | [BR_STATE_DISABLED] = "disabled", | 25 | [BR_STATE_DISABLED] = "disabled", |
@@ -31,7 +31,7 @@ static const char *const br_port_state_names[] = { | |||
31 | 31 | ||
32 | void br_log_state(const struct net_bridge_port *p) | 32 | void br_log_state(const struct net_bridge_port *p) |
33 | { | 33 | { |
34 | br_info(p->br, "port %u(%s) entering %s state\n", | 34 | br_info(p->br, "port %u(%s) entered %s state\n", |
35 | (unsigned) p->port_no, p->dev->name, | 35 | (unsigned) p->port_no, p->dev->name, |
36 | br_port_state_names[p->state]); | 36 | br_port_state_names[p->state]); |
37 | } | 37 | } |
@@ -186,7 +186,7 @@ static void br_record_config_information(struct net_bridge_port *p, | |||
186 | p->designated_cost = bpdu->root_path_cost; | 186 | p->designated_cost = bpdu->root_path_cost; |
187 | p->designated_bridge = bpdu->bridge_id; | 187 | p->designated_bridge = bpdu->bridge_id; |
188 | p->designated_port = bpdu->port_id; | 188 | p->designated_port = bpdu->port_id; |
189 | p->designated_age = jiffies + bpdu->message_age; | 189 | p->designated_age = jiffies - bpdu->message_age; |
190 | 190 | ||
191 | mod_timer(&p->message_age_timer, jiffies | 191 | mod_timer(&p->message_age_timer, jiffies |
192 | + (p->br->max_age - bpdu->message_age)); | 192 | + (p->br->max_age - bpdu->message_age)); |