diff options
Diffstat (limited to 'net/tipc/port.c')
| -rw-r--r-- | net/tipc/port.c | 39 |
1 files changed, 4 insertions, 35 deletions
diff --git a/net/tipc/port.c b/net/tipc/port.c index 5c14c7801ee6..5fd7acce01ea 100644 --- a/net/tipc/port.c +++ b/net/tipc/port.c | |||
| @@ -165,7 +165,7 @@ void tipc_port_mcast_rcv(struct sk_buff *buf, struct tipc_port_list *dp) | |||
| 165 | msg_set_destnode(msg, tipc_own_addr); | 165 | msg_set_destnode(msg, tipc_own_addr); |
| 166 | if (dp->count == 1) { | 166 | if (dp->count == 1) { |
| 167 | msg_set_destport(msg, dp->ports[0]); | 167 | msg_set_destport(msg, dp->ports[0]); |
| 168 | tipc_port_rcv(buf); | 168 | tipc_sk_rcv(buf); |
| 169 | tipc_port_list_free(dp); | 169 | tipc_port_list_free(dp); |
| 170 | return; | 170 | return; |
| 171 | } | 171 | } |
| @@ -180,7 +180,7 @@ void tipc_port_mcast_rcv(struct sk_buff *buf, struct tipc_port_list *dp) | |||
| 180 | if ((index == 0) && (cnt != 0)) | 180 | if ((index == 0) && (cnt != 0)) |
| 181 | item = item->next; | 181 | item = item->next; |
| 182 | msg_set_destport(buf_msg(b), item->ports[index]); | 182 | msg_set_destport(buf_msg(b), item->ports[index]); |
| 183 | tipc_port_rcv(b); | 183 | tipc_sk_rcv(b); |
| 184 | } | 184 | } |
| 185 | } | 185 | } |
| 186 | exit: | 186 | exit: |
| @@ -343,7 +343,7 @@ int tipc_reject_msg(struct sk_buff *buf, u32 err) | |||
| 343 | /* send returned message & dispose of rejected message */ | 343 | /* send returned message & dispose of rejected message */ |
| 344 | src_node = msg_prevnode(msg); | 344 | src_node = msg_prevnode(msg); |
| 345 | if (in_own_node(src_node)) | 345 | if (in_own_node(src_node)) |
| 346 | tipc_port_rcv(rbuf); | 346 | tipc_sk_rcv(rbuf); |
| 347 | else | 347 | else |
| 348 | tipc_link_xmit(rbuf, src_node, msg_link_selector(rmsg)); | 348 | tipc_link_xmit(rbuf, src_node, msg_link_selector(rmsg)); |
| 349 | exit: | 349 | exit: |
| @@ -754,37 +754,6 @@ int tipc_port_shutdown(u32 ref) | |||
| 754 | return tipc_port_disconnect(ref); | 754 | return tipc_port_disconnect(ref); |
| 755 | } | 755 | } |
| 756 | 756 | ||
| 757 | /** | ||
| 758 | * tipc_port_rcv - receive message from lower layer and deliver to port user | ||
| 759 | */ | ||
| 760 | int tipc_port_rcv(struct sk_buff *buf) | ||
| 761 | { | ||
| 762 | struct tipc_port *p_ptr; | ||
| 763 | struct tipc_msg *msg = buf_msg(buf); | ||
| 764 | u32 destport = msg_destport(msg); | ||
| 765 | u32 dsz = msg_data_sz(msg); | ||
| 766 | u32 err; | ||
| 767 | |||
| 768 | /* forward unresolved named message */ | ||
| 769 | if (unlikely(!destport)) { | ||
| 770 | tipc_net_route_msg(buf); | ||
| 771 | return dsz; | ||
| 772 | } | ||
| 773 | |||
| 774 | /* validate destination & pass to port, otherwise reject message */ | ||
| 775 | p_ptr = tipc_port_lock(destport); | ||
| 776 | if (likely(p_ptr)) { | ||
| 777 | err = tipc_sk_rcv(&tipc_port_to_sock(p_ptr)->sk, buf); | ||
| 778 | tipc_port_unlock(p_ptr); | ||
| 779 | if (likely(!err)) | ||
| 780 | return dsz; | ||
| 781 | } else { | ||
| 782 | err = TIPC_ERR_NO_PORT; | ||
| 783 | } | ||
| 784 | |||
| 785 | return tipc_reject_msg(buf, err); | ||
| 786 | } | ||
| 787 | |||
| 788 | /* | 757 | /* |
| 789 | * tipc_port_iovec_rcv: Concatenate and deliver sectioned | 758 | * tipc_port_iovec_rcv: Concatenate and deliver sectioned |
| 790 | * message for this node. | 759 | * message for this node. |
| @@ -798,7 +767,7 @@ static int tipc_port_iovec_rcv(struct tipc_port *sender, | |||
| 798 | 767 | ||
| 799 | res = tipc_msg_build(&sender->phdr, msg_sect, len, MAX_MSG_SIZE, &buf); | 768 | res = tipc_msg_build(&sender->phdr, msg_sect, len, MAX_MSG_SIZE, &buf); |
| 800 | if (likely(buf)) | 769 | if (likely(buf)) |
| 801 | tipc_port_rcv(buf); | 770 | tipc_sk_rcv(buf); |
| 802 | return res; | 771 | return res; |
| 803 | } | 772 | } |
| 804 | 773 | ||
