Browse Source

dns: skip padding record

Nick Peng 2 years ago
parent
commit
934701941b
2 changed files with 4 additions and 0 deletions
  1. 3 0
      src/dns.c
  2. 1 0
      src/dns.h

+ 3 - 0
src/dns.c

@@ -1652,6 +1652,9 @@ static int _dns_decode_opt(struct dns_context *context, dns_rr_type type, unsign
 				return -1;
 				return -1;
 			}
 			}
 		} break;
 		} break;
+		case DNS_OPT_T_PADDING:
+			context->ptr += opt_len;
+			break;
 		default:
 		default:
 			context->ptr += opt_len;
 			context->ptr += opt_len;
 			tlog(TLOG_DEBUG, "DNS opt type = %d not supported", opt_code);
 			tlog(TLOG_DEBUG, "DNS opt type = %d not supported", opt_code);

+ 1 - 0
src/dns.h

@@ -76,6 +76,7 @@ typedef enum dns_opt_code {
 	DNS_OPT_T_ECS = 8, // OPT ECS
 	DNS_OPT_T_ECS = 8, // OPT ECS
 	DNS_OPT_T_COOKIE = 10, //OPT Cookie
 	DNS_OPT_T_COOKIE = 10, //OPT Cookie
 	DNS_OPT_T_TCP_KEEPALIVE = 11,
 	DNS_OPT_T_TCP_KEEPALIVE = 11,
+	DNS_OPT_T_PADDING = 12,
 	DNS_OPT_T_ALL = 255
 	DNS_OPT_T_ALL = 255
 } dns_opt_code_t;
 } dns_opt_code_t;