Skip to content

Commit

Permalink
1.1.2 2022-09-23
Browse files Browse the repository at this point in the history
# 1.1.2 2022-09-23
* XMap 1.1.2 Minor Release.
* Fix Bugs:
  * Fix the print issue of DNS modules
  • Loading branch information
idealeer committed Sep 23, 2022
1 parent 807a42f commit 637cca8
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 14 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@
* XMap 1.1.1 Minor Release.
* Fix Bugs:
* Fix the memory leakage issue

# 1.1.2 2022-09-23
* XMap 1.1.2 Minor Release.
* Fix Bugs:
* Fix the print issue of DNS modules
6 changes: 4 additions & 2 deletions src/probe_modules/module_dnsf.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ static int index_questions_f = 0;
* (below, and setup_qtype_str_map_f())
*/
const char *qtype_strs_f[] = {"A", "NS", "CNAME", "SOA", "PTR",
"MX", "TXT", "AAAA", "RRSIG", "ANY"};
"MX", "TXT", "AAAA", "RRSIG", "ANY"};
const int qtype_strs_len_f = 10;

const dns_qtype qtype_strid_to_qtype_f[] = {
Expand Down Expand Up @@ -1049,9 +1049,11 @@ void dnsf_print_packet(FILE *fp, void *packet) {
uint16_t bytes_consumed = 0;
char *question_name = get_name_f(data, data_len, (char *) dns_header_p,
udp_len, &bytes_consumed);
char *qname = ((char *) dns_header_p) + sizeof(dns_header);
int qname_len = strlen(qname) + 1;
dns_question_tail *tail_p =
(dns_question_tail *) ((char *) dns_header_p + sizeof(dns_header) +
strlen(question_name));
qname_len);

fprintf_eth_header(fp, eth_header);
fprintf_ip_header(fp, ip_header);
Expand Down
6 changes: 4 additions & 2 deletions src/probe_modules/module_dnsr.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static int index_questions_r = 0;
* (below, and setup_qtype_str_map_r())
*/
const char *qtype_strs_r[] = {"A", "NS", "CNAME", "SOA", "PTR",
"MX", "TXT", "AAAA", "RRSIG", "ANY"};
"MX", "TXT", "AAAA", "RRSIG", "ANY"};
const int qtype_strs_len_r = 10;

const dns_qtype qtype_strid_to_qtype_r[] = {
Expand Down Expand Up @@ -1038,9 +1038,11 @@ void dnsr_print_packet(FILE *fp, void *packet) {
uint16_t bytes_consumed = 0;
char *question_name = get_name_r(data, data_len, (char *) dns_header_p,
udp_len, &bytes_consumed);
char *qname = ((char *) dns_header_p) + sizeof(dns_header);
int qname_len = strlen(qname) + 1;
dns_question_tail *tail_p =
(dns_question_tail *) ((char *) dns_header_p + sizeof(dns_header) +
strlen(question_name));
qname_len);

fprintf_eth_header(fp, eth_header);
fprintf_ip_header(fp, ip_header);
Expand Down
6 changes: 4 additions & 2 deletions src/probe_modules/module_dnss.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static int index_questions_s = 0;
* (below, and setup_qtype_str_map_s())
*/
const char *qtype_strs_s[] = {"A", "NS", "CNAME", "SOA", "PTR",
"MX", "TXT", "AAAA", "RRSIG", "ANY"};
"MX", "TXT", "AAAA", "RRSIG", "ANY"};
const int qtype_strs_len_s = 10;

const dns_qtype qtype_strid_to_qtype_s[] = {
Expand Down Expand Up @@ -1055,9 +1055,11 @@ void dnss_print_packet(FILE *fp, void *packet) {
uint16_t bytes_consumed = 0;
char *question_name = get_name_s(data, data_len, (char *) dns_header_p,
udp_len, &bytes_consumed);
char *qname = ((char *) dns_header_p) + sizeof(dns_header);
int qname_len = strlen(qname) + 1;
dns_question_tail *tail_p =
(dns_question_tail *) ((char *) dns_header_p + sizeof(dns_header) +
strlen(question_name));
qname_len);

fprintf_eth_header(fp, eth_header);
fprintf_ip_header(fp, ip_header);
Expand Down
6 changes: 4 additions & 2 deletions src/probe_modules/module_dnsv.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ static int index_questions_v = 0;
* (below, and setup_qtype_str_map_v())
*/
const char *qtype_strs_v[] = {"A", "NS", "CNAME", "SOA", "PTR",
"MX", "TXT", "AAAA", "RRSIG", "ANY"};
"MX", "TXT", "AAAA", "RRSIG", "ANY"};
const int qtype_strs_len_v = 10;

const dns_qtype qtype_strid_to_qtype_v[] = {
Expand Down Expand Up @@ -1048,9 +1048,11 @@ void dnsv_print_packet(FILE *fp, void *packet) {
uint16_t bytes_consumed = 0;
char *question_name = get_name_v(data, data_len, (char *) dns_header_p,
udp_len, &bytes_consumed);
char *qname = ((char *) dns_header_p) + sizeof(dns_header);
int qname_len = strlen(qname) + 1;
dns_question_tail *tail_p =
(dns_question_tail *) ((char *) dns_header_p + sizeof(dns_header) +
strlen(question_name));
qname_len);

fprintf_eth_header(fp, eth_header);
fprintf_ip_header(fp, ip_header);
Expand Down
10 changes: 6 additions & 4 deletions src/probe_modules/module_dnsx.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ static int index_questions_x = 0;
* (below, and setup_qtype_str_map_x())
*/
const char *qtype_strs_x[] = {"A", "NS", "CNAME", "SOA", "PTR",
"MX", "TXT", "AAAA", "RRSIG", "ANY",
"SIG", "SRV", "DS", "DNSKEY", "TLSA",
"SVCB", "HTTPS", "CAA", "HTTPSSVC"};
"MX", "TXT", "AAAA", "RRSIG", "ANY",
"SIG", "SRV", "DS", "DNSKEY", "TLSA",
"SVCB", "HTTPS", "CAA", "HTTPSSVC"};
const int qtype_strs_len_x = 19;

const dns_qtype qtype_strid_to_qtype_x[] = {
Expand Down Expand Up @@ -1081,9 +1081,11 @@ void dnsx_print_packet(FILE *fp, void *packet) {
uint16_t bytes_consumed = 0;
char *question_name = get_name_x(data, data_len, (char *) dns_header_p,
udp_len, &bytes_consumed);
char *qname = ((char *) dns_header_p) + sizeof(dns_header);
int qname_len = strlen(qname) + 1;
dns_question_tail *tail_p =
(dns_question_tail *) ((char *) dns_header_p + sizeof(dns_header) +
strlen(question_name));
qname_len);

fprintf_eth_header(fp, eth_header);
fprintf_ip_header(fp, ip_header);
Expand Down
6 changes: 4 additions & 2 deletions src/probe_modules/module_dnsz.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static int index_questions_z = 0;
* (below, and setup_qtype_str_map_z())
*/
const char *qtype_strs_z[] = {"A", "NS", "CNAME", "SOA", "PTR",
"MX", "TXT", "AAAA", "RRSIG", "ANY"};
"MX", "TXT", "AAAA", "RRSIG", "ANY"};
const int qtype_strs_len_z = 10;

const dns_qtype qtype_strid_to_qtype_z[] = {
Expand Down Expand Up @@ -1038,9 +1038,11 @@ void dnsz_print_packet(FILE *fp, void *packet) {
uint16_t bytes_consumed = 0;
char *question_name = get_name_z(data, data_len, (char *) dns_header_p,
udp_len, &bytes_consumed);
char *qname = ((char *) dns_header_p) + sizeof(dns_header);
int qname_len = strlen(qname) + 1;
dns_question_tail *tail_p =
(dns_question_tail *) ((char *) dns_header_p + sizeof(dns_header) +
strlen(question_name));
qname_len);

fprintf_eth_header(fp, eth_header);
fprintf_ip_header(fp, ip_header);
Expand Down

0 comments on commit 637cca8

Please sign in to comment.