summaryrefslogtreecommitdiffstats
path: root/net/tipc/msg.h
diff options
context:
space:
mode:
authorJon Maloy <jon.maloy@ericsson.com>2018-09-28 20:23:21 +0200
committerDavid S. Miller <davem@davemloft.net>2018-09-29 11:24:22 -0700
commit25b9221b959483f17c2964d0922869e16caa86b5 (patch)
treeefe153ded226c9b0046ff7612fa90fb0883e93b2 /net/tipc/msg.h
parent39fdc9c71f652cdf056ec3341581bde805444b57 (diff)
downloadblackbird-op-linux-25b9221b959483f17c2964d0922869e16caa86b5.tar.gz
blackbird-op-linux-25b9221b959483f17c2964d0922869e16caa86b5.zip
tipc: add SYN bit to connection setup messages
Messages intended for intitating a connection are currently indistinguishable from regular datagram messages. The TIPC protocol specification defines bit 17 in word 0 as a SYN bit to allow sanity check of such messages in the listening socket, but this has so far never been implemented. We do that in this commit. Acked-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/msg.h')
-rw-r--r--net/tipc/msg.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index a4e944d59394..cd64d7b2a0fe 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -216,6 +216,16 @@ static inline void msg_set_non_seq(struct tipc_msg *m, u32 n)
msg_set_bits(m, 0, 20, 1, n);
}
+static inline int msg_is_syn(struct tipc_msg *m)
+{
+ return msg_bits(m, 0, 17, 1);
+}
+
+static inline void msg_set_syn(struct tipc_msg *m, u32 d)
+{
+ msg_set_bits(m, 0, 17, 1, d);
+}
+
static inline int msg_dest_droppable(struct tipc_msg *m)
{
return msg_bits(m, 0, 19, 1);
OpenPOWER on IntegriCloud