mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
fibs_multibind_test: Explicitly cast the checksum value
Otherwise gcc warns about the (intentionall) truncated value and raises
an error.
Fixes: 7034563f8ef3 ("tests: Add some FIB multibind test cases")
(cherry picked from commit 400ce6248be986d52b3944c1ed01db3b26243454)
This commit is contained in:
parent
5dbfe9631d
commit
b9e59283ef
1 changed files with 3 additions and 2 deletions
|
|
@ -418,7 +418,7 @@ ping(int s, const struct sockaddr *sa, socklen_t salen)
|
|||
memset(&icmp, 0, sizeof(icmp));
|
||||
icmp.icmp.icmp_type = ICMP_ECHO;
|
||||
icmp.icmp.icmp_code = 0;
|
||||
icmp.icmp.icmp_cksum = htons(~(ICMP_ECHO << 8));
|
||||
icmp.icmp.icmp_cksum = htons((unsigned short)~(ICMP_ECHO << 8));
|
||||
n = sendto(s, &icmp, sizeof(icmp), 0, sa, salen);
|
||||
ATF_REQUIRE_MSG(n == (ssize_t)sizeof(icmp), "sendto failed: %s",
|
||||
strerror(errno));
|
||||
|
|
@ -438,7 +438,8 @@ ping6(int s, const struct sockaddr *sa, socklen_t salen)
|
|||
memset(&icmp6, 0, sizeof(icmp6));
|
||||
icmp6.icmp6.icmp6_type = ICMP6_ECHO_REQUEST;
|
||||
icmp6.icmp6.icmp6_code = 0;
|
||||
icmp6.icmp6.icmp6_cksum = htons(~(ICMP6_ECHO_REQUEST << 8));
|
||||
icmp6.icmp6.icmp6_cksum =
|
||||
htons((unsigned short)~(ICMP6_ECHO_REQUEST << 8));
|
||||
n = sendto(s, &icmp6, sizeof(icmp6), 0, sa, salen);
|
||||
ATF_REQUIRE_MSG(n == (ssize_t)sizeof(icmp6), "sendto failed: %s",
|
||||
strerror(errno));
|
||||
|
|
|
|||
Loading…
Reference in a new issue