replace another field access with a glue macro
This commit is contained in:
parent
3412541370
commit
a38d2e4ab0
1 changed files with 1 additions and 3 deletions
|
|
@ -2,7 +2,6 @@
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <err.h>
|
#include <err.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
|
||||||
#include "../src/hammer.h"
|
#include "../src/hammer.h"
|
||||||
#include "dns_common.h"
|
#include "dns_common.h"
|
||||||
#include "dns.h"
|
#include "dns.h"
|
||||||
|
|
@ -29,8 +28,7 @@ bool is_zero(HParseResult *p) {
|
||||||
bool validate_dns(HParseResult *p) {
|
bool validate_dns(HParseResult *p) {
|
||||||
if (TT_SEQUENCE != p->ast->token_type)
|
if (TT_SEQUENCE != p->ast->token_type)
|
||||||
return false;
|
return false;
|
||||||
assert(p->ast->seq->elements[0]->token_type == (HTokenType)TT_dns_header);
|
dns_header_t *header = H_FIELD(dns_header, 0);
|
||||||
dns_header_t *header = (dns_header_t *)p->ast->seq->elements[0]->user;
|
|
||||||
size_t qd = header->question_count;
|
size_t qd = header->question_count;
|
||||||
size_t an = header->answer_count;
|
size_t an = header->answer_count;
|
||||||
size_t ns = header->authority_count;
|
size_t ns = header->authority_count;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue