.. | .. |
---|
567 | 567 | n->capabilities, &n->bc_entry.inputq1, |
---|
568 | 568 | &n->bc_entry.namedq, snd_l, &n->bc_entry.link)) { |
---|
569 | 569 | pr_warn("Broadcast rcv link creation failed, no memory\n"); |
---|
570 | | - kfree(n); |
---|
| 570 | + tipc_node_put(n); |
---|
571 | 571 | n = NULL; |
---|
572 | 572 | goto exit; |
---|
573 | 573 | } |
---|
.. | .. |
---|
1152 | 1152 | bool addr_match = false; |
---|
1153 | 1153 | bool sign_match = false; |
---|
1154 | 1154 | bool link_up = false; |
---|
| 1155 | + bool link_is_reset = false; |
---|
1155 | 1156 | bool accept_addr = false; |
---|
1156 | | - bool reset = true; |
---|
| 1157 | + bool reset = false; |
---|
1157 | 1158 | char *if_name; |
---|
1158 | 1159 | unsigned long intv; |
---|
1159 | 1160 | u16 session; |
---|
.. | .. |
---|
1173 | 1174 | /* Prepare to validate requesting node's signature and media address */ |
---|
1174 | 1175 | l = le->link; |
---|
1175 | 1176 | link_up = l && tipc_link_is_up(l); |
---|
| 1177 | + link_is_reset = l && tipc_link_is_reset(l); |
---|
1176 | 1178 | addr_match = l && !memcmp(&le->maddr, maddr, sizeof(*maddr)); |
---|
1177 | 1179 | sign_match = (signature == n->signature); |
---|
1178 | 1180 | |
---|
1179 | 1181 | /* These three flags give us eight permutations: */ |
---|
1180 | 1182 | |
---|
1181 | 1183 | if (sign_match && addr_match && link_up) { |
---|
1182 | | - /* All is fine. Do nothing. */ |
---|
1183 | | - reset = false; |
---|
| 1184 | + /* All is fine. Ignore requests. */ |
---|
1184 | 1185 | /* Peer node is not a container/local namespace */ |
---|
1185 | 1186 | if (!n->peer_hash_mix) |
---|
1186 | 1187 | n->peer_hash_mix = hash_mixes; |
---|
.. | .. |
---|
1205 | 1206 | */ |
---|
1206 | 1207 | accept_addr = true; |
---|
1207 | 1208 | *respond = true; |
---|
| 1209 | + reset = true; |
---|
1208 | 1210 | } else if (!sign_match && addr_match && link_up) { |
---|
1209 | 1211 | /* Peer node rebooted. Two possibilities: |
---|
1210 | 1212 | * - Delayed re-discovery; this link endpoint has already |
---|
.. | .. |
---|
1236 | 1238 | n->signature = signature; |
---|
1237 | 1239 | accept_addr = true; |
---|
1238 | 1240 | *respond = true; |
---|
| 1241 | + reset = true; |
---|
1239 | 1242 | } |
---|
1240 | 1243 | |
---|
1241 | 1244 | if (!accept_addr) |
---|
.. | .. |
---|
1264 | 1267 | tipc_link_fsm_evt(l, LINK_RESET_EVT); |
---|
1265 | 1268 | if (n->state == NODE_FAILINGOVER) |
---|
1266 | 1269 | tipc_link_fsm_evt(l, LINK_FAILOVER_BEGIN_EVT); |
---|
| 1270 | + link_is_reset = tipc_link_is_reset(l); |
---|
1267 | 1271 | le->link = l; |
---|
1268 | 1272 | n->link_cnt++; |
---|
1269 | 1273 | tipc_node_calculate_timer(n, l); |
---|
.. | .. |
---|
1276 | 1280 | memcpy(&le->maddr, maddr, sizeof(*maddr)); |
---|
1277 | 1281 | exit: |
---|
1278 | 1282 | tipc_node_write_unlock(n); |
---|
1279 | | - if (reset && l && !tipc_link_is_reset(l)) |
---|
| 1283 | + if (reset && !link_is_reset) |
---|
1280 | 1284 | tipc_node_link_down(n, b->identity, false); |
---|
1281 | 1285 | tipc_node_put(n); |
---|
1282 | 1286 | } |
---|