48
48
* struct tipc_link_req - information about an ongoing link setup request
49
49
* @bearer: bearer issuing requests
50
50
* @dest: destination address for request messages
51
- * @domain: network domain to which links can be established
52
51
* @num_nodes: number of nodes currently discovered (i.e. with an active link)
53
52
* @lock: spinlock for controlling access to requests
54
53
* @buf: request message to be (repeatedly) sent
58
57
struct tipc_link_req {
59
58
struct tipc_bearer * bearer ;
60
59
struct tipc_media_addr dest ;
61
- u32 domain ;
62
60
int num_nodes ;
63
61
spinlock_t lock ;
64
62
struct sk_buff * buf ;
@@ -69,14 +67,13 @@ struct tipc_link_req {
69
67
/**
70
68
* tipc_disc_init_msg - initialize a link setup message
71
69
* @type: message type (request or response)
72
- * @dest_domain: network domain of node(s) which should respond to message
73
70
* @b_ptr: ptr to bearer issuing message
74
71
*/
75
- static struct sk_buff * tipc_disc_init_msg (u32 type , u32 dest_domain ,
76
- struct tipc_bearer * b_ptr )
72
+ static struct sk_buff * tipc_disc_init_msg (u32 type , struct tipc_bearer * b_ptr )
77
73
{
78
74
struct sk_buff * buf = tipc_buf_acquire (INT_H_SIZE );
79
75
struct tipc_msg * msg ;
76
+ u32 dest_domain = b_ptr -> domain ;
80
77
81
78
if (buf ) {
82
79
msg = buf_msg (buf );
@@ -149,7 +146,7 @@ void tipc_disc_rcv(struct sk_buff *buf, struct tipc_bearer *b_ptr)
149
146
}
150
147
if (!tipc_in_scope (dest , tipc_own_addr ))
151
148
return ;
152
- if (!tipc_in_scope (b_ptr -> link_req -> domain , orig ))
149
+ if (!tipc_in_scope (b_ptr -> domain , orig ))
153
150
return ;
154
151
155
152
/* Locate structure corresponding to requesting node */
@@ -242,7 +239,7 @@ void tipc_disc_rcv(struct sk_buff *buf, struct tipc_bearer *b_ptr)
242
239
link_fully_up = link_working_working (link );
243
240
244
241
if ((type == DSC_REQ_MSG ) && !link_fully_up ) {
245
- rbuf = tipc_disc_init_msg (DSC_RESP_MSG , orig , b_ptr );
242
+ rbuf = tipc_disc_init_msg (DSC_RESP_MSG , b_ptr );
246
243
if (rbuf ) {
247
244
tipc_bearer_send (b_ptr , rbuf , & media_addr );
248
245
kfree_skb (rbuf );
@@ -306,7 +303,7 @@ static void disc_timeout(struct tipc_link_req *req)
306
303
spin_lock_bh (& req -> lock );
307
304
308
305
/* Stop searching if only desired node has been found */
309
- if (tipc_node (req -> domain ) && req -> num_nodes ) {
306
+ if (tipc_node (req -> bearer -> domain ) && req -> num_nodes ) {
310
307
req -> timer_intv = TIPC_LINK_REQ_INACTIVE ;
311
308
goto exit ;
312
309
}
@@ -342,24 +339,22 @@ static void disc_timeout(struct tipc_link_req *req)
342
339
*
343
340
* Returns 0 if successful, otherwise -errno.
344
341
*/
345
- int tipc_disc_create (struct tipc_bearer * b_ptr , struct tipc_media_addr * dest ,
346
- u32 dest_domain )
342
+ int tipc_disc_create (struct tipc_bearer * b_ptr , struct tipc_media_addr * dest )
347
343
{
348
344
struct tipc_link_req * req ;
349
345
350
346
req = kmalloc (sizeof (* req ), GFP_ATOMIC );
351
347
if (!req )
352
348
return - ENOMEM ;
353
349
354
- req -> buf = tipc_disc_init_msg (DSC_REQ_MSG , dest_domain , b_ptr );
350
+ req -> buf = tipc_disc_init_msg (DSC_REQ_MSG , b_ptr );
355
351
if (!req -> buf ) {
356
352
kfree (req );
357
353
return - ENOMSG ;
358
354
}
359
355
360
356
memcpy (& req -> dest , dest , sizeof (* dest ));
361
357
req -> bearer = b_ptr ;
362
- req -> domain = dest_domain ;
363
358
req -> num_nodes = 0 ;
364
359
req -> timer_intv = TIPC_LINK_REQ_INIT ;
365
360
spin_lock_init (& req -> lock );
0 commit comments