aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Paul Maloy <jon.maloy@ericsson.com>2014-02-13 17:29:12 -0500
committerDavid S. Miller <davem@davemloft.net>2014-02-13 17:57:06 -0500
commit3bb533800c698d5e8a8b01dbfc37e147260988f2 (patch)
tree558dc18dfc43d50d95b2e882ea97cd64df47218b
parentf006c9c70fda4676157e00caa2efa74646709d72 (diff)
tipc: change signature of tunnelling reception function
After the earlier commits in this series related to the function tipc_link_tunnel_rcv(), we can now go further and simplify its signature. The function now consumes all DUPLICATE packets, and only returns such ORIGINAL packets that are ready for immediate delivery, i.e., no more link level protocol processing needs to be done by the caller. As a consequence, the the caller, tipc_rcv(), does not access the link pointer after call return, and it becomes unnecessary to pass a link pointer reference in the call. Instead, we now only pass it the tunnel link's owner node, which is sufficient to find the destination link for the tunnelled packet. Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Reviewed-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/tipc/link.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index 26a54f4f3c63..f9f90681a59d 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -78,7 +78,7 @@ static const char *link_unk_evt = "Unknown link event ";
78static void link_handle_out_of_seq_msg(struct tipc_link *l_ptr, 78static void link_handle_out_of_seq_msg(struct tipc_link *l_ptr,
79 struct sk_buff *buf); 79 struct sk_buff *buf);
80static void link_recv_proto_msg(struct tipc_link *l_ptr, struct sk_buff *buf); 80static void link_recv_proto_msg(struct tipc_link *l_ptr, struct sk_buff *buf);
81static int tipc_link_tunnel_rcv(struct tipc_link **l_ptr, 81static int tipc_link_tunnel_rcv(struct tipc_node *n_ptr,
82 struct sk_buff **buf); 82 struct sk_buff **buf);
83static void link_set_supervision_props(struct tipc_link *l_ptr, u32 tolerance); 83static void link_set_supervision_props(struct tipc_link *l_ptr, u32 tolerance);
84static int link_send_sections_long(struct tipc_port *sender, 84static int link_send_sections_long(struct tipc_port *sender,
@@ -1597,7 +1597,7 @@ deliver:
1597 tipc_node_unlock(n_ptr); 1597 tipc_node_unlock(n_ptr);
1598 continue; 1598 continue;
1599 case CHANGEOVER_PROTOCOL: 1599 case CHANGEOVER_PROTOCOL:
1600 if (!tipc_link_tunnel_rcv(&l_ptr, &buf)) 1600 if (!tipc_link_tunnel_rcv(n_ptr, &buf))
1601 break; 1601 break;
1602 msg = buf_msg(buf); 1602 msg = buf_msg(buf);
1603 seq_no = msg_seqno(msg); 1603 seq_no = msg_seqno(msg);
@@ -2174,7 +2174,7 @@ exit:
2174 * returned to the active link for delivery upwards. 2174 * returned to the active link for delivery upwards.
2175 * Owner node is locked. 2175 * Owner node is locked.
2176 */ 2176 */
2177static int tipc_link_tunnel_rcv(struct tipc_link **l_ptr, 2177static int tipc_link_tunnel_rcv(struct tipc_node *n_ptr,
2178 struct sk_buff **buf) 2178 struct sk_buff **buf)
2179{ 2179{
2180 struct sk_buff *tunnel_buf = *buf; 2180 struct sk_buff *tunnel_buf = *buf;
@@ -2186,15 +2186,9 @@ static int tipc_link_tunnel_rcv(struct tipc_link **l_ptr,
2186 if (bearer_id >= MAX_BEARERS) 2186 if (bearer_id >= MAX_BEARERS)
2187 goto exit; 2187 goto exit;
2188 2188
2189 dest_link = (*l_ptr)->owner->links[bearer_id]; 2189 dest_link = n_ptr->links[bearer_id];
2190 if (!dest_link) 2190 if (!dest_link)
2191 goto exit; 2191 goto exit;
2192 if (dest_link == *l_ptr) {
2193 pr_err("Unexpected changeover message on link <%s>\n",
2194 (*l_ptr)->name);
2195 goto exit;
2196 }
2197 *l_ptr = dest_link;
2198 2192
2199 if (msg_typ == DUPLICATE_MSG) { 2193 if (msg_typ == DUPLICATE_MSG) {
2200 tipc_link_dup_rcv(dest_link, tunnel_buf); 2194 tipc_link_dup_rcv(dest_link, tunnel_buf);