11 #include <sys/types.h>
16 #include "interface.h"
19 int cfg_no_subnet
= 0;
21 static void fuzz_dns_handle_packet(uint8_t *input
, size_t size
)
24 struct interface iface
;
25 struct cache_service
*s
, *t
;
27 memset(&from
, 0, sizeof(from
));
28 memset(&iface
, 0, sizeof(iface
));
31 dns_handle_packet(&iface
, &from
, 1922, input
, size
);
33 avl_for_each_element_safe(&services
, s
, avl
, t
)
34 cache_service_free(s
);
37 int main(int argc
, char *argv
[])
44 fprintf(stderr
, "Usage: %s <packet.bin>\n", argv
[0]);
48 fd
= fopen(argv
[1], "r");
50 perror("unable to open input file\n");
54 buf
= calloc(1, MDNS_BUF_LEN
+1);
58 len
= fread(buf
, 1, MDNS_BUF_LEN
, fd
);
60 fuzz_dns_handle_packet(buf
, len
);