summaryrefslogtreecommitdiff
path: root/net/tipc/net.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-06-27 12:51:00 -0700
committerDavid S. Miller <davem@davemloft.net>2014-06-27 12:51:00 -0700
commit0ff9275a4b1d6b1b0439a79c9cf7c03b38dbe24d (patch)
treed8d74d0ae3e05b1228498f5db04ff88a66b03035 /net/tipc/net.c
parentf5b265039f1381ec048a4d61d47130f71abb119b (diff)
parent60120526c26f42fd658e32bf4a6d548483d09da8 (diff)
downloadlinux-0ff9275a4b1d6b1b0439a79c9cf7c03b38dbe24d.tar.gz
linux-0ff9275a4b1d6b1b0439a79c9cf7c03b38dbe24d.tar.xz
Merge branch 'tipc-next'
Jon Maloy says: ==================== tipc: new unicast transmission code As a step towards making the data transmission code more maintainable and performant, we introduce a number of new functions, both for building, sending and rejecting messages. The new functions will eventually be used for alla data transmission, user data unicast, service internal messaging, and multicast/broadcast. We start with this series, where we introduce the functions, and let user data unicast and the internal connection protocol use them. The remaining users will come in a later series. There are only minor changes to data structures, and no protocol changes, so the older functions can still be used in parallel for some time. Until the old functions are removed, we use temporary names for the new functions, such as tipc_build_msg2, tipc_link_xmit2. It should be noted that the first two commits are unrelated to the rest of the series. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/net.c')
-rw-r--r--net/tipc/net.c63
1 files changed, 1 insertions, 62 deletions
diff --git a/net/tipc/net.c b/net/tipc/net.c
index f64375e7f99f..7fcc94998fea 100644
--- a/net/tipc/net.c
+++ b/net/tipc/net.c
@@ -1,7 +1,7 @@
/*
* net/tipc/net.c: TIPC network routing code
*
- * Copyright (c) 1995-2006, Ericsson AB
+ * Copyright (c) 1995-2006, 2014, Ericsson AB
* Copyright (c) 2005, 2010-2011, Wind River Systems
* All rights reserved.
*
@@ -104,67 +104,6 @@
* - A local spin_lock protecting the queue of subscriber events.
*/
-static void net_route_named_msg(struct sk_buff *buf)
-{
- struct tipc_msg *msg = buf_msg(buf);
- u32 dnode;
- u32 dport;
-
- if (!msg_named(msg)) {
- kfree_skb(buf);
- return;
- }
-
- dnode = addr_domain(msg_lookup_scope(msg));
- dport = tipc_nametbl_translate(msg_nametype(msg), msg_nameinst(msg), &dnode);
- if (dport) {
- msg_set_destnode(msg, dnode);
- msg_set_destport(msg, dport);
- tipc_net_route_msg(buf);
- return;
- }
- tipc_reject_msg(buf, TIPC_ERR_NO_NAME);
-}
-
-void tipc_net_route_msg(struct sk_buff *buf)
-{
- struct tipc_msg *msg;
- u32 dnode;
-
- if (!buf)
- return;
- msg = buf_msg(buf);
-
- /* Handle message for this node */
- dnode = msg_short(msg) ? tipc_own_addr : msg_destnode(msg);
- if (tipc_in_scope(dnode, tipc_own_addr)) {
- if (msg_isdata(msg)) {
- if (msg_mcast(msg))
- tipc_port_mcast_rcv(buf, NULL);
- else if (msg_destport(msg))
- tipc_sk_rcv(buf);
- else
- net_route_named_msg(buf);
- return;
- }
- switch (msg_user(msg)) {
- case NAME_DISTRIBUTOR:
- tipc_named_rcv(buf);
- break;
- case CONN_MANAGER:
- tipc_port_proto_rcv(buf);
- break;
- default:
- kfree_skb(buf);
- }
- return;
- }
-
- /* Handle message for another node */
- skb_trim(buf, msg_size(msg));
- tipc_link_xmit(buf, dnode, msg_link_selector(msg));
-}
-
int tipc_net_start(u32 addr)
{
char addr_string[16];