]> asedeno.scripts.mit.edu Git - linux.git/commit
tipc: refactor function tipc_msg_reverse()
authorJon Maloy <jon.maloy@ericsson.com>
Fri, 28 Sep 2018 18:23:18 +0000 (20:23 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sat, 29 Sep 2018 18:24:22 +0000 (11:24 -0700)
commit5cbdbd1a1f30a083aada44595ca42952fc31e866
tree504887bd2f99020985c48601406fa1807f39b67e
parenta337531b942bd8a03e7052444d7e36972aac2d92
tipc: refactor function tipc_msg_reverse()

The function tipc_msg_reverse() is reversing the header of a message
while reusing the original buffer. We have seen at several occasions
that this may have unfortunate side effects when the buffer to be
reversed is a clone.

In one of the following commits we will again need to reverse cloned
buffers, so this is the right time to permanently eliminate this
problem. In this commit we let the said function always consume the
original buffer and replace it with a new one when applicable.

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>
net/tipc/msg.c