Repair ping-leases option

A misplaced bracket passed 'sizeof(*addr1) == -1' instead of 'sizeof(*addr1)'
to sendto(), causing it to fail. This prevented icmp_ping4() from sending
ICMP echo requests.

Consequently, the 'ping-leases' option has been non-functional since
this bug was introduced in commit 2aaa287a.

Signed-off-by: Grigory Trenin <grigory.trenin@gmail.com>
This commit is contained in:
Grigory Trenin
2025-11-21 15:59:01 -05:00
parent 88054ae4c2
commit a307bda153
2 changed files with 3 additions and 2 deletions
+1
View File
@@ -3,6 +3,7 @@
- Fixed issues with PAM authentication when combined with pam_sssd (#618) - Fixed issues with PAM authentication when combined with pam_sssd (#618)
- Enhanced the seccomp filters to address issue in testing (#627) - Enhanced the seccomp filters to address issue in testing (#627)
- Fixed "unexpected URL" errors for Cisco AnyConnect clients - Fixed "unexpected URL" errors for Cisco AnyConnect clients
- Fixed the 'ping-leases' option, which was broken since version 1.1.1
* Version 1.3.0 (released 2024-05-05) * Version 1.3.0 (released 2024-05-05)
- Switch to https://github.com/nodejs/llhttp from http-parser. - Switch to https://github.com/nodejs/llhttp from http-parser.
+2 -2
View File
@@ -202,7 +202,7 @@ int icmp_ping4(main_server_st *s, struct sockaddr_in *addr1)
pkt->icmp_cksum = in_cksum((unsigned short *)pkt, sizeof(packet1)); pkt->icmp_cksum = in_cksum((unsigned short *)pkt, sizeof(packet1));
while (sendto(pingsock, packet1, DEFDATALEN + ICMP_MINLEN, 0, while (sendto(pingsock, packet1, DEFDATALEN + ICMP_MINLEN, 0,
(struct sockaddr *)addr1, sizeof(*addr1) == -1) && (struct sockaddr *)addr1, sizeof(*addr1)) == -1 &&
retry(errno)) retry(errno))
; ;
/* listen for replies */ /* listen for replies */
@@ -300,7 +300,7 @@ int icmp_ping6(main_server_st *s, struct sockaddr_in6 *addr1)
setsockopt(pingsock, SOL_RAW, IPV6_CHECKSUM, &sockopt, sizeof(sockopt)); setsockopt(pingsock, SOL_RAW, IPV6_CHECKSUM, &sockopt, sizeof(sockopt));
#endif #endif
while (sendto(pingsock, packet1, DEFDATALEN + sizeof(struct icmp6_hdr), while (sendto(pingsock, packet1, DEFDATALEN + sizeof(struct icmp6_hdr),
0, (struct sockaddr *)addr1, sizeof(*addr1) == -1) && 0, (struct sockaddr *)addr1, sizeof(*addr1)) == -1 &&
retry(errno)) retry(errno))
; ;