diff options
-rw-r--r-- | net/bridge/br_private.h | 1 | ||||
-rw-r--r-- | net/bridge/br_stp.c | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index 54578f274d85..78cc364997d9 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h | |||
@@ -124,6 +124,7 @@ struct net_bridge_port | |||
124 | bridge_id designated_bridge; | 124 | bridge_id designated_bridge; |
125 | u32 path_cost; | 125 | u32 path_cost; |
126 | u32 designated_cost; | 126 | u32 designated_cost; |
127 | unsigned long designated_age; | ||
127 | 128 | ||
128 | struct timer_list forward_delay_timer; | 129 | struct timer_list forward_delay_timer; |
129 | struct timer_list hold_timer; | 130 | struct timer_list hold_timer; |
diff --git a/net/bridge/br_stp.c b/net/bridge/br_stp.c index bb4383e84de9..fcff62251547 100644 --- a/net/bridge/br_stp.c +++ b/net/bridge/br_stp.c | |||
@@ -164,8 +164,7 @@ void br_transmit_config(struct net_bridge_port *p) | |||
164 | else { | 164 | else { |
165 | struct net_bridge_port *root | 165 | struct net_bridge_port *root |
166 | = br_get_port(br, br->root_port); | 166 | = br_get_port(br, br->root_port); |
167 | bpdu.message_age = br->max_age | 167 | bpdu.message_age = (jiffies - root->designated_age) |
168 | - (root->message_age_timer.expires - jiffies) | ||
169 | + MESSAGE_AGE_INCR; | 168 | + MESSAGE_AGE_INCR; |
170 | } | 169 | } |
171 | bpdu.max_age = br->max_age; | 170 | bpdu.max_age = br->max_age; |
@@ -189,6 +188,7 @@ static inline void br_record_config_information(struct net_bridge_port *p, | |||
189 | p->designated_cost = bpdu->root_path_cost; | 188 | p->designated_cost = bpdu->root_path_cost; |
190 | p->designated_bridge = bpdu->bridge_id; | 189 | p->designated_bridge = bpdu->bridge_id; |
191 | p->designated_port = bpdu->port_id; | 190 | p->designated_port = bpdu->port_id; |
191 | p->designated_age = jiffies + bpdu->message_age; | ||
192 | 192 | ||
193 | mod_timer(&p->message_age_timer, jiffies | 193 | mod_timer(&p->message_age_timer, jiffies |
194 | + (p->br->max_age - bpdu->message_age)); | 194 | + (p->br->max_age - bpdu->message_age)); |