| .. | .. |
|---|
| 74 | 74 | /** |
|---|
| 75 | 75 | * tipc_disc_init_msg - initialize a link setup message |
|---|
| 76 | 76 | * @net: the applicable net namespace |
|---|
| 77 | | - * @type: message type (request or response) |
|---|
| 77 | + * @mtyp: message type (request or response) |
|---|
| 78 | 78 | * @b: ptr to bearer issuing message |
|---|
| 79 | 79 | */ |
|---|
| 80 | 80 | static void tipc_disc_init_msg(struct net *net, struct sk_buff *skb, |
|---|
| .. | .. |
|---|
| 94 | 94 | msg_set_dest_domain(hdr, dest_domain); |
|---|
| 95 | 95 | msg_set_bc_netid(hdr, tn->net_id); |
|---|
| 96 | 96 | b->media->addr2msg(msg_media_addr(hdr), &b->addr); |
|---|
| 97 | + msg_set_peer_net_hash(hdr, tipc_net_hash_mixes(net, tn->random)); |
|---|
| 97 | 98 | msg_set_node_id(hdr, tipc_own_id(net)); |
|---|
| 98 | 99 | } |
|---|
| 99 | 100 | |
|---|
| .. | .. |
|---|
| 146 | 147 | { |
|---|
| 147 | 148 | struct net *net = d->net; |
|---|
| 148 | 149 | struct tipc_net *tn = tipc_net(net); |
|---|
| 149 | | - bool trial = time_before(jiffies, tn->addr_trial_end); |
|---|
| 150 | 150 | u32 self = tipc_own_addr(net); |
|---|
| 151 | + bool trial = time_before(jiffies, tn->addr_trial_end) && !self; |
|---|
| 151 | 152 | |
|---|
| 152 | 153 | if (mtyp == DSC_TRIAL_FAIL_MSG) { |
|---|
| 153 | 154 | if (!trial) |
|---|
| .. | .. |
|---|
| 166 | 167 | |
|---|
| 167 | 168 | /* Apply trial address if we just left trial period */ |
|---|
| 168 | 169 | if (!trial && !self) { |
|---|
| 169 | | - tipc_sched_net_finalize(net, tn->trial_addr); |
|---|
| 170 | + schedule_work(&tn->work); |
|---|
| 170 | 171 | msg_set_prevnode(buf_msg(d->skb), tn->trial_addr); |
|---|
| 171 | 172 | msg_set_type(buf_msg(d->skb), DSC_REQ_MSG); |
|---|
| 172 | 173 | } |
|---|
| .. | .. |
|---|
| 193 | 194 | { |
|---|
| 194 | 195 | struct tipc_net *tn = tipc_net(net); |
|---|
| 195 | 196 | struct tipc_msg *hdr = buf_msg(skb); |
|---|
| 197 | + u32 pnet_hash = msg_peer_net_hash(hdr); |
|---|
| 196 | 198 | u16 caps = msg_node_capabilities(hdr); |
|---|
| 197 | 199 | bool legacy = tn->legacy_addr_format; |
|---|
| 198 | 200 | u32 sugg = msg_sugg_node_addr(hdr); |
|---|
| .. | .. |
|---|
| 208 | 210 | u32 self; |
|---|
| 209 | 211 | int err; |
|---|
| 210 | 212 | |
|---|
| 211 | | - skb_linearize(skb); |
|---|
| 213 | + if (skb_linearize(skb)) { |
|---|
| 214 | + kfree_skb(skb); |
|---|
| 215 | + return; |
|---|
| 216 | + } |
|---|
| 212 | 217 | hdr = buf_msg(skb); |
|---|
| 213 | 218 | |
|---|
| 214 | 219 | if (caps & TIPC_NODE_ID128) |
|---|
| .. | .. |
|---|
| 241 | 246 | return; |
|---|
| 242 | 247 | if (!tipc_in_scope(legacy, b->domain, src)) |
|---|
| 243 | 248 | return; |
|---|
| 244 | | - tipc_node_check_dest(net, src, peer_id, b, caps, signature, |
|---|
| 249 | + tipc_node_check_dest(net, src, peer_id, b, caps, signature, pnet_hash, |
|---|
| 245 | 250 | &maddr, &respond, &dupl_addr); |
|---|
| 246 | 251 | if (dupl_addr) |
|---|
| 247 | 252 | disc_dupl_alert(b, src, &maddr); |
|---|
| .. | .. |
|---|
| 305 | 310 | if (!time_before(jiffies, tn->addr_trial_end) && !tipc_own_addr(net)) { |
|---|
| 306 | 311 | mod_timer(&d->timer, jiffies + TIPC_DISC_INIT); |
|---|
| 307 | 312 | spin_unlock_bh(&d->lock); |
|---|
| 308 | | - tipc_sched_net_finalize(net, tn->trial_addr); |
|---|
| 313 | + schedule_work(&tn->work); |
|---|
| 309 | 314 | return; |
|---|
| 310 | 315 | } |
|---|
| 311 | 316 | |
|---|
| .. | .. |
|---|
| 337 | 342 | * @net: the applicable net namespace |
|---|
| 338 | 343 | * @b: ptr to bearer issuing requests |
|---|
| 339 | 344 | * @dest: destination address for request messages |
|---|
| 340 | | - * @dest_domain: network domain to which links can be established |
|---|
| 345 | + * @skb: pointer to created frame |
|---|
| 341 | 346 | * |
|---|
| 342 | 347 | * Returns 0 if successful, otherwise -errno. |
|---|
| 343 | 348 | */ |
|---|
| .. | .. |
|---|
| 391 | 396 | * tipc_disc_reset - reset object to send periodic link setup requests |
|---|
| 392 | 397 | * @net: the applicable net namespace |
|---|
| 393 | 398 | * @b: ptr to bearer issuing requests |
|---|
| 394 | | - * @dest_domain: network domain to which links can be established |
|---|
| 395 | 399 | */ |
|---|
| 396 | 400 | void tipc_disc_reset(struct net *net, struct tipc_bearer *b) |
|---|
| 397 | 401 | { |
|---|