diff options
-rw-r--r-- | net/tipc/name_table.c | 17 | ||||
-rw-r--r-- | net/tipc/port.c | 2 |
2 files changed, 14 insertions, 5 deletions
diff --git a/net/tipc/name_table.c b/net/tipc/name_table.c index c2224f98e64f..c6a1ae36952e 100644 --- a/net/tipc/name_table.c +++ b/net/tipc/name_table.c | |||
@@ -539,10 +539,17 @@ struct publication *tipc_nametbl_remove_publ(u32 type, u32 lower, | |||
539 | } | 539 | } |
540 | 540 | ||
541 | /* | 541 | /* |
542 | * tipc_nametbl_translate - translate name to port id | 542 | * tipc_nametbl_translate - perform name translation |
543 | * | 543 | * |
544 | * Note: on entry 'destnode' is the search domain used during translation; | 544 | * On entry, 'destnode' is the search domain used during translation. |
545 | * on exit it passes back the node address of the matching port (if any) | 545 | * |
546 | * On exit: | ||
547 | * - if name translation is deferred to another node/cluster/zone, | ||
548 | * leaves 'destnode' unchanged (will be non-zero) and returns 0 | ||
549 | * - if name translation is attempted and succeeds, sets 'destnode' | ||
550 | * to publishing node and returns port reference (will be non-zero) | ||
551 | * - if name translation is attempted and fails, sets 'destnode' to 0 | ||
552 | * and returns 0 | ||
546 | */ | 553 | */ |
547 | 554 | ||
548 | u32 tipc_nametbl_translate(u32 type, u32 instance, u32 *destnode) | 555 | u32 tipc_nametbl_translate(u32 type, u32 instance, u32 *destnode) |
@@ -552,6 +559,7 @@ u32 tipc_nametbl_translate(u32 type, u32 instance, u32 *destnode) | |||
552 | struct publication *publ; | 559 | struct publication *publ; |
553 | struct name_seq *seq; | 560 | struct name_seq *seq; |
554 | u32 ref = 0; | 561 | u32 ref = 0; |
562 | u32 node = 0; | ||
555 | 563 | ||
556 | if (!tipc_in_scope(*destnode, tipc_own_addr)) | 564 | if (!tipc_in_scope(*destnode, tipc_own_addr)) |
557 | return 0; | 565 | return 0; |
@@ -609,11 +617,12 @@ u32 tipc_nametbl_translate(u32 type, u32 instance, u32 *destnode) | |||
609 | } | 617 | } |
610 | 618 | ||
611 | ref = publ->ref; | 619 | ref = publ->ref; |
612 | *destnode = publ->node; | 620 | node = publ->node; |
613 | no_match: | 621 | no_match: |
614 | spin_unlock_bh(&seq->lock); | 622 | spin_unlock_bh(&seq->lock); |
615 | not_found: | 623 | not_found: |
616 | read_unlock_bh(&tipc_nametbl_lock); | 624 | read_unlock_bh(&tipc_nametbl_lock); |
625 | *destnode = node; | ||
617 | return ref; | 626 | return ref; |
618 | } | 627 | } |
619 | 628 | ||
diff --git a/net/tipc/port.c b/net/tipc/port.c index c4b5a347037a..b103d7630c82 100644 --- a/net/tipc/port.c +++ b/net/tipc/port.c | |||
@@ -1221,7 +1221,7 @@ int tipc_send2name(u32 ref, struct tipc_name const *name, unsigned int domain, | |||
1221 | msg_set_destnode(msg, destnode); | 1221 | msg_set_destnode(msg, destnode); |
1222 | msg_set_destport(msg, destport); | 1222 | msg_set_destport(msg, destport); |
1223 | 1223 | ||
1224 | if (likely(destport)) { | 1224 | if (likely(destport || destnode)) { |
1225 | if (likely(destnode == tipc_own_addr)) | 1225 | if (likely(destnode == tipc_own_addr)) |
1226 | res = tipc_port_recv_sections(p_ptr, num_sect, | 1226 | res = tipc_port_recv_sections(p_ptr, num_sect, |
1227 | msg_sect, total_len); | 1227 | msg_sect, total_len); |