1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-08 15:39:05 +00:00

Use stable_sort when sorting OS fingerprints for comparison.

Often an OS will respond differently to the second transmission of a
probe than to the first. For example, sometimes after it sends a SYN/ACK
it loses patience and sends a RST. The different second probe often has
different flags and options. In OS integration, I normally want to
compare with the first set of responses whenever they differ, so keep
them in the first position when sorting.
This commit is contained in:
david
2012-02-14 02:59:28 +00:00
parent 7807926f15
commit 04f595e692

View File

@@ -213,8 +213,8 @@ void FingerPrint::sort() {
unsigned int i;
for (i = 0; i < tests.size(); i++)
std::sort(tests[i].results.begin(), tests[i].results.end());
std::sort(tests.begin(), tests.end());
std::stable_sort(tests[i].results.begin(), tests[i].results.end());
std::stable_sort(tests.begin(), tests.end());
}
/* Compare an observed value (e.g. "45") against an OS DB expression (e.g.