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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user