summaryrefslogtreecommitdiffstats
path: root/net/tipc/msg.h
diff options
context:
space:
mode:
authorJon Paul Maloy <jon.maloy@ericsson.com>2015-02-05 08:36:39 -0500
committerDavid S. Miller <davem@davemloft.net>2015-02-05 19:00:02 -0500
commite3a77561e7d326e18881ef3cb84807892b353459 (patch)
treeb3d958bcfa747d87a979936e5814b7a5aeba97f3 /net/tipc/msg.h
parentd570d86497eeb11410b1c096d82ade11bcdd966c (diff)
tipc: split up function tipc_msg_eval()
The function tipc_msg_eval() is in reality doing two related, but different tasks. First it tries to find a new destination for named messages, in case there was no first lookup, or if the first lookup failed. Second, it does what its name suggests, evaluating the validity of the message and its destination, and returning an appropriate error code depending on the result. This is confusing, and in this commit we choose to break it up into two functions. A new function, tipc_msg_lookup_dest(), first attempts to find a new destination, if the message is of the right type. If this lookup fails, or if the message should not be subject to a second lookup, the already existing tipc_msg_reverse() is called. This function performs prepares the message for rejection, if applicable. Reviewed-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.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/tipc/msg.h b/net/tipc/msg.h
index f7ea95458c6f..60702992933d 100644
--- a/net/tipc/msg.h
+++ b/net/tipc/msg.h
@@ -750,18 +750,19 @@ static inline u32 msg_tot_origport(struct tipc_msg *m)
750struct sk_buff *tipc_buf_acquire(u32 size); 750struct sk_buff *tipc_buf_acquire(u32 size);
751bool tipc_msg_reverse(u32 own_addr, struct sk_buff *buf, u32 *dnode, 751bool tipc_msg_reverse(u32 own_addr, struct sk_buff *buf, u32 *dnode,
752 int err); 752 int err);
753int tipc_msg_eval(struct net *net, struct sk_buff *buf, u32 *dnode);
754void tipc_msg_init(u32 own_addr, struct tipc_msg *m, u32 user, u32 type, 753void tipc_msg_init(u32 own_addr, struct tipc_msg *m, u32 user, u32 type,
755 u32 hsize, u32 destnode); 754 u32 hsize, u32 destnode);
756struct sk_buff *tipc_msg_create(uint user, uint type, 755struct sk_buff *tipc_msg_create(uint user, uint type, uint hdr_sz,
757 uint hdr_sz, uint data_sz, u32 dnode, 756 uint data_sz, u32 dnode, u32 onode,
758 u32 onode, u32 dport, u32 oport, int errcode); 757 u32 dport, u32 oport, int errcode);
759int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf); 758int tipc_buf_append(struct sk_buff **headbuf, struct sk_buff **buf);
760bool tipc_msg_bundle(struct sk_buff_head *list, struct sk_buff *skb, u32 mtu); 759bool tipc_msg_bundle(struct sk_buff_head *list, struct sk_buff *skb, u32 mtu);
761bool tipc_msg_make_bundle(struct sk_buff_head *list, 760bool tipc_msg_make_bundle(struct sk_buff_head *list,
762 struct sk_buff *skb, u32 mtu, u32 dnode); 761 struct sk_buff *skb, u32 mtu, u32 dnode);
763int tipc_msg_build(struct tipc_msg *mhdr, struct msghdr *m, 762int tipc_msg_build(struct tipc_msg *mhdr, struct msghdr *m,
764 int offset, int dsz, int mtu, struct sk_buff_head *list); 763 int offset, int dsz, int mtu, struct sk_buff_head *list);
764bool tipc_msg_lookup_dest(struct net *net, struct sk_buff *skb, u32 *dnode,
765 int *err);
765struct sk_buff *tipc_msg_reassemble(struct sk_buff_head *list); 766struct sk_buff *tipc_msg_reassemble(struct sk_buff_head *list);
766 767
767#endif 768#endif