tipc: introduce new tipc_sk_respond() function
authorJon Paul Maloy <jon.maloy@ericsson.com>
Wed, 22 Jul 2015 14:11:19 +0000 (10:11 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sun, 26 Jul 2015 23:31:50 +0000 (16:31 -0700)
commitbcd3ffd4f6d7c994c93be2ab8598fdfb2952a1f1
treeacc0313d0b76c136e0b32944c45dadd69a8f0bcb
parent29042e19f2c602fabe4705b5b719550b4627639c
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>
net/tipc/msg.c
net/tipc/msg.h
net/tipc/socket.c