/** Compress "label" by looking at it recursively.
*
+ * @param[in] start start of the input buffer holding one or more labels
+ * @param[in] end end of the input buffer
+ * @param[out] new_search Where the parent call to dns_label_compress() should start searching from,
+ * instead of from "start"
+ * @param[in] label new label to add to the buffer, generally == end.
+ * @param[out] new_end new end of the input label after compression
+ * @return
+ * - false, we didn't compress the input
+ * - true, we did compress the input.
*/
static bool dns_label_compress(uint8_t const *start, uint8_t const *end, uint8_t const **new_search,
uint8_t *label, uint8_t **new_end)
while (q < end) {
if (*q == 0x00) {
q++;
+
+ /*
+ * None of the previous stuff
+ * matched, so we tell the caller
+ * to start searching from the
+ * next name.
+ */
search = q;
continue;
}
while (q < end) {
if (*q == 0x00) {
q++;
+
+ /*
+ * None of the previous stuff matched, so
+ * we tell the caller to start searching
+ * from the next name.
+ */
search = q;
continue;
}