summaryrefslogtreecommitdiffstats
path: root/net/tipc/msg.c
diff options
context:
space:
mode:
authorJon Paul Maloy <jon.maloy@ericsson.com>2015-07-22 16:11:19 +0200
committerDavid S. Miller <davem@davemloft.net>2015-07-27 01:31:50 +0200
commitbcd3ffd4f6d7c994c93be2ab8598fdfb2952a1f1 (patch)
treeacc0313d0b76c136e0b32944c45dadd69a8f0bcb /net/tipc/msg.c
parenttipc: let function tipc_msg_reverse() expand header when needed (diff)
downloadlinux-bcd3ffd4f6d7c994c93be2ab8598fdfb2952a1f1.tar.xz
linux-bcd3ffd4f6d7c994c93be2ab8598fdfb2952a1f1.zip
tipc: introduce new tipc_sk_respond() function
Currently, we use the code sequence if (msg_reverse()) tipc_link_xmit_skb() at numerous locations in socket.c. The preparation of arguments for these calls, as well as the sequence itself, makes the code unecessarily complex. In this commit, we introduce a new function, tipc_sk_respond(), that performs this call combination. We also replace some, but not yet all, of these explicit call sequences with calls to the new function. Notably, we let the function tipc_sk_proto_rcv() use the new function to directly send out PROBE_REPLY messages, instead of deferring this to the calling tipc_sk_rcv() function, as we do now. 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.c')
-rw-r--r--net/tipc/msg.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/tipc/msg.c b/net/tipc/msg.c
index 4339aab93034..b6cc58ec7346 100644
--- a/net/tipc/msg.c
+++ b/net/tipc/msg.c
@@ -469,7 +469,7 @@ bool tipc_msg_make_bundle(struct sk_buff **skb, struct tipc_msg *msg,
* Consumes buffer at failure
* Returns true if success, otherwise false
*/
-bool tipc_msg_reverse(u32 own_node, struct sk_buff **skb, u32 *dnode, int err)
+bool tipc_msg_reverse(u32 own_node, struct sk_buff **skb, int err)
{
struct sk_buff *_skb = *skb;
struct tipc_msg *hdr = buf_msg(_skb);
@@ -508,7 +508,6 @@ bool tipc_msg_reverse(u32 own_node, struct sk_buff **skb, u32 *dnode, int err)
msg_set_prevnode(hdr, own_node);
msg_set_orignode(hdr, own_node);
msg_set_size(hdr, msg_hdr_sz(hdr) + dlen);
- *dnode = msg_destnode(hdr);
skb_trim(_skb, msg_size(hdr));
skb_orphan(_skb);
return true;