← Commit list

3c8799b8a

Denys Vlasenko
Denys Vlasenko
2010-11-29
FAILED Duration: 220s

Subject

ping: set not only IP_TTL, but also IP_MULTICAST_TTL

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

networking/ping.c+4 -2
@@ -675,9 +675,11 @@ static void ping4(len_and_sockaddr *lsa)
sockopt = (datalen * 2) + 7 * 1024; /* giving it a bit of extra room */
setsockopt(pingsock, SOL_SOCKET, SO_RCVBUF, &sockopt, sizeof(sockopt));
- if (opt_ttl != 0)
- //setsockopt(pingsock, IPPROTO_IP, IP_MULTICAST_TTL, &opt_ttl, sizeof(opt_ttl));
+ if (opt_ttl != 0) {
setsockopt(pingsock, IPPROTO_IP, IP_TTL, &opt_ttl, sizeof(opt_ttl));
+ /* above doesnt affect packets sent to bcast IP, so... */
+ setsockopt(pingsock, IPPROTO_IP, IP_MULTICAST_TTL, &opt_ttl, sizeof(opt_ttl));
+ }
signal(SIGINT, print_stats_and_exit);