aboutsummaryrefslogtreecommitdiff
path: root/networking/traceroute.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/traceroute.c')
-rw-r--r--networking/traceroute.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/networking/traceroute.c b/networking/traceroute.c
index 3f1a9ab46..057f8591a 100644
--- a/networking/traceroute.c
+++ b/networking/traceroute.c
@@ -505,7 +505,7 @@ send_probe(int seq, int ttl)
struct outdata6_t *pkt = (void *) outdata;
pkt->ident6 = ident;
pkt->seq6 = htonl(seq);
- /*gettimeofday(&pkt->tv, &tz);*/
+ /*xgettimeofday(&pkt->tv);*/
icp = outicmp6;
} else
#endif
@@ -716,8 +716,8 @@ packet4_ok(int read_len, int seq)
// Off: 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)
+ /* && up->uh_sport == ident */
+ && up->uh_dport == htons(port + seq)
) {
return (type == ICMP_TIMXCEED ? -1 : code + 1);
}
@@ -896,7 +896,7 @@ traceroute_init(int op, char **argv)
op |= getopt32(argv, "^"
OPT_STRING
- "\0" "-1:x-x" /* minimum 1 arg */
+ "\0" "-1" /* minimum 1 arg */
, &tos_str, &device, &max_ttl_str, &port_str, &nprobes_str
, &source, &waittime_str, &pausemsecs_str, &first_ttl_str
);
@@ -985,8 +985,13 @@ traceroute_init(int op, char **argv)
snd = xsocket(AF_INET, SOCK_DGRAM, 0);
}
#if ENABLE_TRACEROUTE6
+# if defined(__FreeBSD__)
+# define SOL_V6_OPTION SOL_IPV6
+# else
+# define SOL_V6_OPTION SOL_RAW
+# endif
else {
- if (setsockopt_int(rcvsock, SOL_RAW, IPV6_CHECKSUM, 2) != 0)
+ if (setsockopt_int(rcvsock, SOL_V6_OPTION, IPV6_CHECKSUM, 2) != 0)
bb_perror_msg_and_die("setsockopt(%s)", "IPV6_CHECKSUM");
if (op & OPT_USE_ICMP)
snd = xsocket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6);