From b1d5cf7348105cb8205b0fe7c54494b1fefd80cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustavo=20Andr=C3=A9=20dos=20Santos=20Lopes?= Date: Fri, 8 Oct 2010 23:02:37 +0000 Subject: - Added numeric record type and raw data for unknown DNS record types. --- ext/standard/dns.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'ext/standard/dns.c') diff --git a/ext/standard/dns.c b/ext/standard/dns.c index 103d6904f8..22c44525e4 100644 --- a/ext/standard/dns.c +++ b/ext/standard/dns.c @@ -679,7 +679,15 @@ static u_char *php_parserr(u_char *cp, querybuf *answer, int type_to_fetch, int add_assoc_string(*subarray, "replacement", name, 1); break; default: - cp += dlen; + { + char buf[10]; /* max length of short + sizeof(id #) */ + snprintf(buf, 10, "id #%hu", type); + buf[10-1] = '\0'; + add_assoc_string(*subarray, "type", buf, 1); + add_assoc_stringl(*subarray, "data", (char*) cp, (uint) dlen, 1); + cp += dlen; + break; + } } add_assoc_string(*subarray, "class", "IN", 1); -- cgit v1.2.1