aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Paul Maloy <jon.maloy@ericsson.com>2014-02-13 17:29:13 -0500
committerDavid S. Miller <davem@davemloft.net>2014-02-13 17:57:06 -0500
commit1e9d47a948f44af4bb040e10a3a852b6bc3d6a90 (patch)
treea7bef850e33b2ba9c7bcfb95e1d3c0ee82a5954f
parent3bb533800c698d5e8a8b01dbfc37e147260988f2 (diff)
tipc: more cleanup of tunnelling reception function
We simplify and slim down the code in function tipc_tunnel_rcv() No impact on the users of this function. Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/tipc/link.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c
index f9f90681a59d..3136788799d8 100644
--- a/net/tipc/link.c
+++ b/net/tipc/link.c
@@ -2180,9 +2180,10 @@ static int tipc_link_tunnel_rcv(struct tipc_node *n_ptr,
2180 struct sk_buff *tunnel_buf = *buf; 2180 struct sk_buff *tunnel_buf = *buf;
2181 struct tipc_link *dest_link; 2181 struct tipc_link *dest_link;
2182 struct tipc_msg *tunnel_msg = buf_msg(tunnel_buf); 2182 struct tipc_msg *tunnel_msg = buf_msg(tunnel_buf);
2183 u32 msg_typ = msg_type(tunnel_msg);
2184 u32 bearer_id = msg_bearer_id(tunnel_msg); 2183 u32 bearer_id = msg_bearer_id(tunnel_msg);
2185 2184
2185 *buf = NULL;
2186
2186 if (bearer_id >= MAX_BEARERS) 2187 if (bearer_id >= MAX_BEARERS)
2187 goto exit; 2188 goto exit;
2188 2189
@@ -2190,24 +2191,16 @@ static int tipc_link_tunnel_rcv(struct tipc_node *n_ptr,
2190 if (!dest_link) 2191 if (!dest_link)
2191 goto exit; 2192 goto exit;
2192 2193
2193 if (msg_typ == DUPLICATE_MSG) { 2194 if (msg_type(tunnel_msg) == DUPLICATE_MSG)
2194 tipc_link_dup_rcv(dest_link, tunnel_buf); 2195 tipc_link_dup_rcv(dest_link, tunnel_buf);
2195 goto exit; 2196 else if (msg_type(tunnel_msg) == ORIGINAL_MSG)
2196 }
2197
2198 if (msg_type(tunnel_msg) == ORIGINAL_MSG) {
2199 *buf = tipc_link_failover_rcv(dest_link, tunnel_buf); 2197 *buf = tipc_link_failover_rcv(dest_link, tunnel_buf);
2198 else
2199 pr_warn("%sunknown tunnel pkt received\n", link_co_err);
2200 2200
2201 /* Do we have a buffer/buffer chain to return? */
2202 if (*buf != NULL) {
2203 kfree_skb(tunnel_buf);
2204 return 1;
2205 }
2206 }
2207exit: 2201exit:
2208 *buf = NULL;
2209 kfree_skb(tunnel_buf); 2202 kfree_skb(tunnel_buf);
2210 return 0; 2203 return *buf != NULL;
2211} 2204}
2212 2205
2213/* 2206/*