RFC 6762 compares tentative records lexicographically as unsigned bytes.
| 851 | |
| 852 | // RFC 6762 compares tentative records lexicographically as unsigned bytes. |
| 853 | static int CompareProbeData(const uint8_t* a, uint16_t a_length, const uint8_t* b, uint16_t b_length) |
| 854 | { |
| 855 | const uint16_t min_length = a_length < b_length ? a_length : b_length; |
| 856 | for (uint16_t i = 0; i < min_length; ++i) |
| 857 | { |
| 858 | if (a[i] != b[i]) |
| 859 | return a[i] < b[i] ? -1 : 1; |
| 860 | } |
| 861 | |
| 862 | if (a_length != b_length) |
| 863 | return a_length < b_length ? -1 : 1; |
| 864 | return 0; |
| 865 | } |
| 866 | |
| 867 | // Records sort by class, then type, then raw rdata bytes, matching the |
| 868 | // simultaneous-probe tiebreak order from RFC 6762 section 8.2. |
no outgoing calls
no test coverage detected