mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
selftests/net: fix a char signedness issue
[ Upstream commit 7b29828c5af6841bdeb9fafa32fdfeff7ab9c407 ]
Signedness of char is signed on x86_64, but unsigned on arm64.
Fix the warning building cmsg_sender.c on signed platforms or
forced with -fsigned-char:
msg_sender.c:455:12:
error: implicit conversion from 'int' to 'char'
changes value from 128 to -128
[-Werror,-Wconstant-conversion]
buf[0] = ICMPV6_ECHO_REQUEST;
constant ICMPV6_ECHO_REQUEST is 128.
Link: https://lwn.net/Articles/911914
Fixes: de17e305a8 ("selftests: net: cmsg_sender: support icmp and raw sockets")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Link: https://lore.kernel.org/r/20231124171645.1011043-3-willemdebruijn.kernel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
249ceee95c
commit
4e999af7cf
@@ -416,9 +416,9 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
struct addrinfo hints, *ai;
|
struct addrinfo hints, *ai;
|
||||||
struct iovec iov[1];
|
struct iovec iov[1];
|
||||||
|
unsigned char *buf;
|
||||||
struct msghdr msg;
|
struct msghdr msg;
|
||||||
char cbuf[1024];
|
char cbuf[1024];
|
||||||
char *buf;
|
|
||||||
int err;
|
int err;
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user