summaryrefslogtreecommitdiff
path: root/net/mctp/af_mctp.c
diff options
context:
space:
mode:
authorJeremy Kerr <jk@codeconstruct.com.au>2024-02-19 17:51:46 +0800
committerPaolo Abeni <pabeni@redhat.com>2024-02-22 13:32:54 +0100
commitee076b73e576b0a052d5686d873346b285ae50ea (patch)
treeda7b0a7fb218ff29eebeb3b7d431805cac60bb9c /net/mctp/af_mctp.c
parent6d5c36565c169376e3c5fc54d01d7c6819381465 (diff)
net: mctp: avoid confusion over local/peer dest/source addresses
We have a double-swap of local and peer addresses in mctp_alloc_local_tag; the arguments in both call sites are swapped, but there is also a swap in the implementation of alloc_local_tag. This is opaque because we're using source/dest address references, which don't match the local/peer semantics. Avoid this confusion by naming the arguments as 'local' and 'peer', and remove the double swap. The calling order now matches mctp_key_alloc. Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au> Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/mctp/af_mctp.c')
-rw-r--r--net/mctp/af_mctp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/mctp/af_mctp.c b/net/mctp/af_mctp.c
index f6be58b68c6f..d8197e9e233b 100644
--- a/net/mctp/af_mctp.c
+++ b/net/mctp/af_mctp.c
@@ -367,7 +367,7 @@ static int mctp_ioctl_alloctag(struct mctp_sock *msk, unsigned long arg)
if (ctl.flags)
return -EINVAL;
- key = mctp_alloc_local_tag(msk, ctl.peer_addr, MCTP_ADDR_ANY,
+ key = mctp_alloc_local_tag(msk, MCTP_ADDR_ANY, ctl.peer_addr,
true, &tag);
if (IS_ERR(key))
return PTR_ERR(key);