mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 08:46:45 +00:00
Merge fc88056180 into 10804bf42a
This commit is contained in:
commit
e57c7a1804
1 changed files with 19 additions and 7 deletions
|
|
@ -3112,15 +3112,27 @@ icmpbad:
|
|||
} else {
|
||||
/* UNKNOWN PROTOCOL **********************************************************/
|
||||
const char *hdrstr;
|
||||
|
||||
hdrstr = nexthdrtoa(hdr.proto, 1);
|
||||
if (hdrstr == NULL || *hdrstr == '\0') {
|
||||
Snprintf(protoinfo, sizeof(protoinfo), "Unknown protocol (%d) %s > %s: %s",
|
||||
hdr.proto, srchost, dsthost, ipinfo);
|
||||
|
||||
/* Check if the ip version is 6 using the hdr struct*/
|
||||
if (hdr.version == 6) {
|
||||
/* It's an IPv6 packet */
|
||||
if (hdrstr == NULL || *hdrstr == '\0') {
|
||||
Snprintf(protoinfo, sizeof(protoinfo), "IPv6 (nh=%d) %s > %s: %s",
|
||||
hdr.proto, srchost, dsthost, ipinfo);
|
||||
} else {
|
||||
Snprintf(protoinfo, sizeof(protoinfo), "IPv6 (nh=%s/%d) %s > %s: %s",
|
||||
hdrstr, hdr.proto, srchost, dsthost, ipinfo);
|
||||
}
|
||||
} else {
|
||||
Snprintf(protoinfo, sizeof(protoinfo), "%s (%d) %s > %s: %s",
|
||||
hdrstr, hdr.proto, srchost, dsthost, ipinfo);
|
||||
}
|
||||
if (hdrstr == NULL || *hdrstr == '\0') {
|
||||
Snprintf(protoinfo, sizeof(protoinfo), "Unknown protocol (%d) %s > %s: %s",
|
||||
hdr.proto, srchost, dsthost, ipinfo);
|
||||
} else {
|
||||
Snprintf(protoinfo, sizeof(protoinfo), "%s (%d) %s > %s: %s",
|
||||
hdrstr, hdr.proto, srchost, dsthost, ipinfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return protoinfo;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue