use IPV6_CHECKSUM only when available.

This commit is contained in:
Nikos Mavrogiannopoulos
2013-12-11 08:54:15 +01:00
parent dd162faf36
commit 0d1b3976ab

View File

@@ -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,