mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-03-07 07:17:00 +08:00
use IPV6_CHECKSUM only when available.
This commit is contained in:
@@ -309,10 +309,11 @@ int icmp_ping6(main_server_st * s,
|
||||
pkt->icmp6_type = ICMP6_ECHO_REQUEST;
|
||||
pkt->icmp6_id = id2;
|
||||
|
||||
#if define(SOL_RAW) && defined(IPV6_CHECKSUM)
|
||||
sockopt = offsetof(struct icmp6_hdr, icmp6_cksum);
|
||||
setsockopt(pingsock, SOL_RAW, IPV6_CHECKSUM,
|
||||
&sockopt, sizeof(sockopt));
|
||||
|
||||
#endif
|
||||
while ((c =
|
||||
sendto(pingsock, packet1,
|
||||
DEFDATALEN + sizeof(struct icmp6_hdr), 0,
|
||||
|
||||
Reference in New Issue
Block a user