diff options
Diffstat (limited to 'net/tipc/link.c')
-rw-r--r-- | net/tipc/link.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c index bcd76b1e440c..1289b4ba404f 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c | |||
@@ -434,15 +434,16 @@ char *tipc_link_name(struct tipc_link *l) | |||
434 | */ | 434 | */ |
435 | bool tipc_link_create(struct net *net, char *if_name, int bearer_id, | 435 | bool tipc_link_create(struct net *net, char *if_name, int bearer_id, |
436 | int tolerance, char net_plane, u32 mtu, int priority, | 436 | int tolerance, char net_plane, u32 mtu, int priority, |
437 | int window, u32 session, u32 self, u32 peer, | 437 | int window, u32 session, u32 self, |
438 | u16 peer_caps, | 438 | u32 peer, u8 *peer_id, u16 peer_caps, |
439 | struct tipc_link *bc_sndlink, | 439 | struct tipc_link *bc_sndlink, |
440 | struct tipc_link *bc_rcvlink, | 440 | struct tipc_link *bc_rcvlink, |
441 | struct sk_buff_head *inputq, | 441 | struct sk_buff_head *inputq, |
442 | struct sk_buff_head *namedq, | 442 | struct sk_buff_head *namedq, |
443 | struct tipc_link **link) | 443 | struct tipc_link **link) |
444 | { | 444 | { |
445 | char *self_str = tipc_own_id_string(net); | 445 | char peer_str[NODE_ID_STR_LEN] = {0,}; |
446 | char self_str[NODE_ID_STR_LEN] = {0,}; | ||
446 | struct tipc_link *l; | 447 | struct tipc_link *l; |
447 | 448 | ||
448 | l = kzalloc(sizeof(*l), GFP_ATOMIC); | 449 | l = kzalloc(sizeof(*l), GFP_ATOMIC); |
@@ -451,11 +452,18 @@ bool tipc_link_create(struct net *net, char *if_name, int bearer_id, | |||
451 | *link = l; | 452 | *link = l; |
452 | l->session = session; | 453 | l->session = session; |
453 | 454 | ||
454 | /* Note: peer i/f name is completed by reset/activate message */ | 455 | /* Set link name for unicast links only */ |
455 | if (strlen(self_str) > 16) | 456 | if (peer_id) { |
456 | sprintf(l->name, "%x:%s-%x:unknown", self, if_name, peer); | 457 | tipc_nodeid2string(self_str, tipc_own_id(net)); |
457 | else | 458 | if (strlen(self_str) > 16) |
458 | sprintf(l->name, "%s:%s-%x:unknown", self_str, if_name, peer); | 459 | sprintf(self_str, "%x", self); |
460 | tipc_nodeid2string(peer_str, peer_id); | ||
461 | if (strlen(peer_str) > 16) | ||
462 | sprintf(peer_str, "%x", peer); | ||
463 | } | ||
464 | /* Peer i/f name will be completed by reset/activate message */ | ||
465 | sprintf(l->name, "%s:%s-%s:unknown", self_str, if_name, peer_str); | ||
466 | |||
459 | strcpy(l->if_name, if_name); | 467 | strcpy(l->if_name, if_name); |
460 | l->addr = peer; | 468 | l->addr = peer; |
461 | l->peer_caps = peer_caps; | 469 | l->peer_caps = peer_caps; |
@@ -503,7 +511,7 @@ bool tipc_link_bc_create(struct net *net, u32 ownnode, u32 peer, | |||
503 | struct tipc_link *l; | 511 | struct tipc_link *l; |
504 | 512 | ||
505 | if (!tipc_link_create(net, "", MAX_BEARERS, 0, 'Z', mtu, 0, window, | 513 | if (!tipc_link_create(net, "", MAX_BEARERS, 0, 'Z', mtu, 0, window, |
506 | 0, ownnode, peer, peer_caps, bc_sndlink, | 514 | 0, ownnode, peer, NULL, peer_caps, bc_sndlink, |
507 | NULL, inputq, namedq, link)) | 515 | NULL, inputq, namedq, link)) |
508 | return false; | 516 | return false; |
509 | 517 | ||