Without this, basic queries using dig fail...
}
/*
- * type + class + TTL
+ * type (2) + class (2) + TTL (4)
+ *
+ * These are overloaded for the OPT RR
+ * and possibly others, but the basic
+ * idea is the same.
*/
if ((p + 8) > end) {
DECODE_FAIL(MISSING_RR_HEADER);
p += 8;
/*
- * rr_len
+ * rr_len
*/
- if ((p + 2) >= end) {
+ if ((p + 2) > end) {
DECODE_FAIL(MISSING_RR_LEN);
return false;
}
len = fr_nbo_to_uint16(p);
- if (len == 0) {
+ if (!is_opt && (len == 0)) {
DECODE_FAIL(ZERO_RR_LEN);
return false;
}