aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/socket.c
diff options
context:
space:
mode:
authorJon Maloy <jon.maloy@ericsson.com>2017-10-13 05:04:17 -0400
committerDavid S. Miller <davem@davemloft.net>2017-10-13 11:46:00 -0400
commit14c04493cb77bc38404dbcb39d5ccbb667831ad7 (patch)
tree24f418f63c5e134c034579f2c01bc44278425d86 /net/tipc/socket.c
parent2d0d21c12dfa3851620f1fa9fe2d444538f1fad4 (diff)
tipc: add ability to order and receive topology events in driver
As preparation for introducing communication groups, we add the ability to issue topology subscriptions and receive topology events from kernel space. This will make it possible for group member sockets to keep track of other group members. Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Acked-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/socket.c')
-rw-r--r--net/tipc/socket.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/net/tipc/socket.c b/net/tipc/socket.c
index d50edd6e0019..9a7e7b5cf23f 100644
--- a/net/tipc/socket.c
+++ b/net/tipc/socket.c
@@ -896,6 +896,10 @@ exit:
896 kfree_skb(skb); 896 kfree_skb(skb);
897} 897}
898 898
899static void tipc_sk_top_evt(struct tipc_sock *tsk, struct tipc_event *evt)
900{
901}
902
899/** 903/**
900 * tipc_sendmsg - send message in connectionless manner 904 * tipc_sendmsg - send message in connectionless manner
901 * @sock: socket structure 905 * @sock: socket structure
@@ -1671,20 +1675,24 @@ static bool filter_rcv(struct sock *sk, struct sk_buff *skb,
1671 struct tipc_msg *hdr = buf_msg(skb); 1675 struct tipc_msg *hdr = buf_msg(skb);
1672 unsigned int limit = rcvbuf_limit(sk, skb); 1676 unsigned int limit = rcvbuf_limit(sk, skb);
1673 int err = TIPC_OK; 1677 int err = TIPC_OK;
1674 int usr = msg_user(hdr);
1675 u32 onode;
1676
1677 if (unlikely(msg_user(hdr) == CONN_MANAGER)) {
1678 tipc_sk_proto_rcv(tsk, skb, xmitq);
1679 return false;
1680 }
1681 1678
1682 if (unlikely(usr == SOCK_WAKEUP)) { 1679 if (unlikely(!msg_isdata(hdr))) {
1683 onode = msg_orignode(hdr); 1680 switch (msg_user(hdr)) {
1681 case CONN_MANAGER:
1682 tipc_sk_proto_rcv(tsk, skb, xmitq);
1683 return false;
1684 case SOCK_WAKEUP:
1685 u32_del(&tsk->cong_links, msg_orignode(hdr));
1686 tsk->cong_link_cnt--;
1687 sk->sk_write_space(sk);
1688 break;
1689 case TOP_SRV:
1690 tipc_sk_top_evt(tsk, (void *)msg_data(hdr));
1691 break;
1692 default:
1693 break;
1694 }
1684 kfree_skb(skb); 1695 kfree_skb(skb);
1685 u32_del(&tsk->cong_links, onode);
1686 tsk->cong_link_cnt--;
1687 sk->sk_write_space(sk);
1688 return false; 1696 return false;
1689 } 1697 }
1690 1698