Skip to content

Commit

Permalink
iscsit: add missing endianess conversion in iscsit_check_inaddr_any
Browse files Browse the repository at this point in the history
Sparse noticed that INADDR_ANY needs to be converted to big endian before
it can be stored in struct sockaddr_in.s_addr.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  • Loading branch information
Christoph Hellwig authored and Nicholas Bellinger committed Oct 2, 2012
1 parent 904753d commit cea0b4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/target/iscsi/iscsi_target.c
Original file line number Diff line number Diff line change
Expand Up @@ -3239,7 +3239,7 @@ static bool iscsit_check_inaddr_any(struct iscsi_np *np)
struct sockaddr_in * sock_in =
(struct sockaddr_in *)&np->np_sockaddr;

if (sock_in->sin_addr.s_addr == INADDR_ANY)
if (sock_in->sin_addr.s_addr == htonl(INADDR_ANY))
ret = true;
}

Expand Down

0 comments on commit cea0b4c

Please sign in to comment.