← Commit list

2a1ce6b20

Denys Vlasenko
Denys Vlasenko
2021-08-15
SUCCESS Duration: 151s

Subject

traceroute: fix compile error due to FreeBSD compat

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/traceroute.c+6 -1
@@ -713,11 +713,16 @@ packet4_ok(int read_len, int seq)
up = (struct udphdr *)((char *)hip + hlen);
if (hlen + 12 <= read_len
&& hip->ip_p == IPPROTO_UDP
-// Off: since we do not form the entire IP packet,
+#if !defined(__FreeBSD__)
+// Disabled source check: since we do not form the entire IP packet,
// but defer it to kernel, we can't set source port,
// and thus can't check it here in the reply
+ /* && up->source == ident */
+ && up->dest == htons(port + seq)
+#else
/* && up->uh_sport == ident */
&& up->uh_dport == htons(port + seq)
+#endif
) {
return (type == ICMP_TIMXCEED ? -1 : code + 1);
}