mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Print "--" for the RTT of traceroute hops if the RTT is unknown. This
can only happen in the case of a directly connected target with no ping or port scan responses, like nmap -PN -sP --send-ip --traceroute <target>
This commit is contained in:
parent
06cc9ad4d1
commit
45b783c573
1 changed files with 10 additions and 3 deletions
13
output.cc
13
output.cc
|
|
@ -1986,7 +1986,10 @@ static void printtraceroute_normal(Target *currenths) {
|
|||
/* Normal hop output. */
|
||||
|
||||
it->display_name(namebuf, sizeof(namebuf));
|
||||
Tbl.addItemFormatted(row, RTT_COL, false, "%.2f ms", it->rtt);
|
||||
if (it->rtt < 0)
|
||||
Tbl.addItem(row, RTT_COL, false, "--");
|
||||
else
|
||||
Tbl.addItemFormatted(row, RTT_COL, false, "%.2f ms", it->rtt);
|
||||
Tbl.addItemFormatted(row, HOST_COL, false, "%s", namebuf);
|
||||
row++;
|
||||
it++;
|
||||
|
|
@ -2029,8 +2032,12 @@ static void printtraceroute_xml(Target *currenths) {
|
|||
it++) {
|
||||
if (it->timedout)
|
||||
continue;
|
||||
log_write(LOG_XML, "<hop ttl=\"%d\" rtt=\"%.2f\" ipaddr=\"%s\"",
|
||||
it->ttl, it->rtt, inet_ntop_ez(&it->addr, sizeof(it->addr)));
|
||||
log_write(LOG_XML, "<hop ttl=\"%d\" ipaddr=\"%s\"",
|
||||
it->ttl, inet_ntop_ez(&it->addr, sizeof(it->addr)));
|
||||
if (it->rtt < 0)
|
||||
log_write(LOG_XML, " rtt=\"--\"");
|
||||
else
|
||||
log_write(LOG_XML, " rtt=\"%.2f\"", it->rtt);
|
||||
if (!it->name.empty())
|
||||
log_write(LOG_XML, " host=\"%s\"", it->name.c_str());
|
||||
log_write(LOG_XML, "/>\n");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue