aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc/group.c
diff options
context:
space:
mode:
authorJon Maloy <jon.maloy@ericsson.com>2017-10-13 11:04:24 +0200
committerDavid S. Miller <davem@davemloft.net>2017-10-13 08:46:00 -0700
commit31c82a2d9d51fccbb85cbd2be983eb115225301c (patch)
treea6681b56dfea5bdae4c6d1459abf6c04131aebec /net/tipc/group.c
parenttipc: introduce communication groups (diff)
downloadlinux-dev-31c82a2d9d51fccbb85cbd2be983eb115225301c.tar.xz
linux-dev-31c82a2d9d51fccbb85cbd2be983eb115225301c.zip
tipc: add second source address to recvmsg()/recvfrom()
With group communication, it becomes important for a message receiver to identify not only from which socket (identfied by a node:port tuple) the message was sent, but also the logical identity (type:instance) of the sending member. We fix this by adding a second instance of struct sockaddr_tipc to the source address area when a message is read. The extra address struct is filled in with data found in the received message header (type,) and in the local member representation struct (instance.) 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/group.c')
-rw-r--r--net/tipc/group.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/tipc/group.c b/net/tipc/group.c
index 3f0e1ce1e3b9..beb214a3420c 100644
--- a/net/tipc/group.c
+++ b/net/tipc/group.c
@@ -61,6 +61,7 @@ struct tipc_member {
struct list_head list;
u32 node;
u32 port;
+ u32 instance;
enum mbr_state state;
u16 bc_rcv_nxt;
};
@@ -282,6 +283,7 @@ void tipc_group_filter_msg(struct tipc_group *grp, struct sk_buff_head *inputq,
if (!tipc_group_is_receiver(m))
goto drop;
+ TIPC_SKB_CB(skb)->orig_member = m->instance;
__skb_queue_tail(inputq, skb);
m->bc_rcv_nxt = msg_grp_bc_seqno(hdr) + 1;
@@ -388,6 +390,7 @@ void tipc_group_member_evt(struct tipc_group *grp,
m->state = MBR_PUBLISHED;
else
m->state = MBR_JOINED;
+ m->instance = evt->found_lower;
tipc_group_proto_xmit(grp, m, GRP_JOIN_MSG, xmitq);
} else if (evt->event == TIPC_WITHDRAWN) {
if (!m)