add CONFIG_UHID for bluetooth hid devices
[firefly-linux-kernel-4.4.55.git] / net / bridge / br_stp.c
index bb4383e84de91ed78e98f1a777410011a7772003..fcff62251547c476659399999d584b4bb31cf380 100644 (file)
@@ -164,8 +164,7 @@ void br_transmit_config(struct net_bridge_port *p)
        else {
                struct net_bridge_port *root
                        = br_get_port(br, br->root_port);
-               bpdu.message_age = br->max_age
-                       - (root->message_age_timer.expires - jiffies)
+               bpdu.message_age = (jiffies - root->designated_age)
                        + MESSAGE_AGE_INCR;
        }
        bpdu.max_age = br->max_age;
@@ -189,6 +188,7 @@ static inline void br_record_config_information(struct net_bridge_port *p,
        p->designated_cost = bpdu->root_path_cost;
        p->designated_bridge = bpdu->bridge_id;
        p->designated_port = bpdu->port_id;
+       p->designated_age = jiffies + bpdu->message_age;
 
        mod_timer(&p->message_age_timer, jiffies
                  + (p->br->max_age - bpdu->message_age));