Commit 050dbddf authored by Bart Van Assche's avatar Bart Van Assche Committed by Jason Gunthorpe

RDMA/siw: Fix port number endianness in a debug message

sin_port and sin6_port are big endian member variables. Convert these port
numbers into CPU endianness before printing.

Link: https://lore.kernel.org/r/20190930231707.48259-5-bvanassche@acm.org
Fixes: 6c52fdc2 ("rdma/siw: connection management")
Signed-off-by: default avatarBart Van Assche <bvanassche@acm.org>
Reviewed-by: default avatarBernard Metzler <bmt@zurich.ibm.com>
Signed-off-by: default avatarJason Gunthorpe <jgg@mellanox.com>
parent 23c1c13c
......@@ -1853,14 +1853,7 @@ static int siw_listen_address(struct iw_cm_id *id, int backlog,
list_add_tail(&cep->listenq, (struct list_head *)id->provider_data);
cep->state = SIW_EPSTATE_LISTENING;
if (addr_family == AF_INET)
siw_dbg(id->device, "Listen at laddr %pI4 %u\n",
&(((struct sockaddr_in *)laddr)->sin_addr),
((struct sockaddr_in *)laddr)->sin_port);
else
siw_dbg(id->device, "Listen at laddr %pI6 %u\n",
&(((struct sockaddr_in6 *)laddr)->sin6_addr),
((struct sockaddr_in6 *)laddr)->sin6_port);
siw_dbg(id->device, "Listen at laddr %pISp\n", laddr);
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment