From: Florian Forster Date: Sun, 15 Mar 2009 10:24:20 +0000 (+0100) Subject: src/liboping.c: Add debugging output to the TTL setting code. X-Git-Tag: liboping-1.1.0~6 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=11970f14b437d4f8f62040f5913ecc4d5f4fbb53;p=liboping.git src/liboping.c: Add debugging output to the TTL setting code. --- diff --git a/src/liboping.c b/src/liboping.c index 0f4c595..65b2ef5 100644 --- a/src/liboping.c +++ b/src/liboping.c @@ -872,11 +872,15 @@ static int ping_set_ttl (pinghost_t *ph, int ttl) if (ph->addrfamily == AF_INET) { - ret = setsockopt (ph->fd, IPPROTO_IP, IP_TTL, &ttl, sizeof (ttl)); + dprintf ("Setting TTLv4 to %i\n", ttl); + ret = setsockopt (ph->fd, IPPROTO_IP, IP_TTL, + &ttl, sizeof (ttl)); } else if (ph->addrfamily == AF_INET6) { - ret = setsockopt (ph->fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, &ttl, sizeof (ttl)); + dprintf ("Setting TTLv6 to %i\n", ttl); + ret = setsockopt (ph->fd, IPPROTO_IPV6, IPV6_UNICAST_HOPS, + &ttl, sizeof (ttl)); } return (ret);