/* Even though Posix requires "strerror_r" to return an "int",
* some systems (e.g. the GNU libc) return a "char *" _and_
* ignore the second argument ... -tokkee */
-char *sstrerror (int errnum, char *buf, size_t buflen)
+static char *sstrerror (int errnum, char *buf, size_t buflen)
{
buf[0] = 0;
dprintf ("No match found for ident = 0x%04x, seq = %i\n",
ident, seq);
}
-
- ptr->recv_ttl = ip_hdr->ip_ttl;
+
+ if (ptr != NULL)
+ ptr->recv_ttl = ip_hdr->ip_ttl;
return (ptr);
}
/* Iterate over all auxiliary data in msghdr */
recv_ttl = -1;
- ph->recv_ttl = -1;
for (cmsg = CMSG_FIRSTHDR (&msghdr); /* {{{ */
cmsg != NULL;
cmsg = CMSG_NXTHDR (&msghdr, cmsg))
ret = 0;
for (ptr = ph; ptr != NULL; ptr = ptr->next)
- ptr->latency = -1.0;
+ {
+ ptr->latency = -1.0;
+ ptr->recv_ttl = -1;
+ }
if (gettimeofday (&nowtime, NULL) == -1)
{
setsockopt (ph->fd, IPPROTO_IP, IP_RECVTTL,
&opt, sizeof (opt));
}
+#if defined(IPPROTO_IPV6) && defined(IPV6_RECVHOPLIMIT)
else if (ph->addrfamily == AF_INET6)
{
int opt = 1;
setsockopt (ph->fd, IPPROTO_IPV6, IPV6_RECVHOPLIMIT,
&opt, sizeof (opt));
}
+#endif
break;
}