Skip to content

Commit 637cca8

Browse files
committed
1.1.2 2022-09-23
# 1.1.2 2022-09-23 * XMap 1.1.2 Minor Release. * Fix Bugs: * Fix the print issue of DNS modules
1 parent 807a42f commit 637cca8

File tree

7 files changed

+31
-14
lines changed

7 files changed

+31
-14
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,8 @@
2727
* XMap 1.1.1 Minor Release.
2828
* Fix Bugs:
2929
* Fix the memory leakage issue
30+
31+
# 1.1.2 2022-09-23
32+
* XMap 1.1.2 Minor Release.
33+
* Fix Bugs:
34+
* Fix the print issue of DNS modules

src/probe_modules/module_dnsf.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static int index_questions_f = 0;
123123
* (below, and setup_qtype_str_map_f())
124124
*/
125125
const char *qtype_strs_f[] = {"A", "NS", "CNAME", "SOA", "PTR",
126-
"MX", "TXT", "AAAA", "RRSIG", "ANY"};
126+
"MX", "TXT", "AAAA", "RRSIG", "ANY"};
127127
const int qtype_strs_len_f = 10;
128128

129129
const dns_qtype qtype_strid_to_qtype_f[] = {
@@ -1049,9 +1049,11 @@ void dnsf_print_packet(FILE *fp, void *packet) {
10491049
uint16_t bytes_consumed = 0;
10501050
char *question_name = get_name_f(data, data_len, (char *) dns_header_p,
10511051
udp_len, &bytes_consumed);
1052+
char *qname = ((char *) dns_header_p) + sizeof(dns_header);
1053+
int qname_len = strlen(qname) + 1;
10521054
dns_question_tail *tail_p =
10531055
(dns_question_tail *) ((char *) dns_header_p + sizeof(dns_header) +
1054-
strlen(question_name));
1056+
qname_len);
10551057

10561058
fprintf_eth_header(fp, eth_header);
10571059
fprintf_ip_header(fp, ip_header);

src/probe_modules/module_dnsr.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static int index_questions_r = 0;
118118
* (below, and setup_qtype_str_map_r())
119119
*/
120120
const char *qtype_strs_r[] = {"A", "NS", "CNAME", "SOA", "PTR",
121-
"MX", "TXT", "AAAA", "RRSIG", "ANY"};
121+
"MX", "TXT", "AAAA", "RRSIG", "ANY"};
122122
const int qtype_strs_len_r = 10;
123123

124124
const dns_qtype qtype_strid_to_qtype_r[] = {
@@ -1038,9 +1038,11 @@ void dnsr_print_packet(FILE *fp, void *packet) {
10381038
uint16_t bytes_consumed = 0;
10391039
char *question_name = get_name_r(data, data_len, (char *) dns_header_p,
10401040
udp_len, &bytes_consumed);
1041+
char *qname = ((char *) dns_header_p) + sizeof(dns_header);
1042+
int qname_len = strlen(qname) + 1;
10411043
dns_question_tail *tail_p =
10421044
(dns_question_tail *) ((char *) dns_header_p + sizeof(dns_header) +
1043-
strlen(question_name));
1045+
qname_len);
10441046

10451047
fprintf_eth_header(fp, eth_header);
10461048
fprintf_ip_header(fp, ip_header);

src/probe_modules/module_dnss.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static int index_questions_s = 0;
118118
* (below, and setup_qtype_str_map_s())
119119
*/
120120
const char *qtype_strs_s[] = {"A", "NS", "CNAME", "SOA", "PTR",
121-
"MX", "TXT", "AAAA", "RRSIG", "ANY"};
121+
"MX", "TXT", "AAAA", "RRSIG", "ANY"};
122122
const int qtype_strs_len_s = 10;
123123

124124
const dns_qtype qtype_strid_to_qtype_s[] = {
@@ -1055,9 +1055,11 @@ void dnss_print_packet(FILE *fp, void *packet) {
10551055
uint16_t bytes_consumed = 0;
10561056
char *question_name = get_name_s(data, data_len, (char *) dns_header_p,
10571057
udp_len, &bytes_consumed);
1058+
char *qname = ((char *) dns_header_p) + sizeof(dns_header);
1059+
int qname_len = strlen(qname) + 1;
10581060
dns_question_tail *tail_p =
10591061
(dns_question_tail *) ((char *) dns_header_p + sizeof(dns_header) +
1060-
strlen(question_name));
1062+
qname_len);
10611063

10621064
fprintf_eth_header(fp, eth_header);
10631065
fprintf_ip_header(fp, ip_header);

src/probe_modules/module_dnsv.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static int index_questions_v = 0;
119119
* (below, and setup_qtype_str_map_v())
120120
*/
121121
const char *qtype_strs_v[] = {"A", "NS", "CNAME", "SOA", "PTR",
122-
"MX", "TXT", "AAAA", "RRSIG", "ANY"};
122+
"MX", "TXT", "AAAA", "RRSIG", "ANY"};
123123
const int qtype_strs_len_v = 10;
124124

125125
const dns_qtype qtype_strid_to_qtype_v[] = {
@@ -1048,9 +1048,11 @@ void dnsv_print_packet(FILE *fp, void *packet) {
10481048
uint16_t bytes_consumed = 0;
10491049
char *question_name = get_name_v(data, data_len, (char *) dns_header_p,
10501050
udp_len, &bytes_consumed);
1051+
char *qname = ((char *) dns_header_p) + sizeof(dns_header);
1052+
int qname_len = strlen(qname) + 1;
10511053
dns_question_tail *tail_p =
10521054
(dns_question_tail *) ((char *) dns_header_p + sizeof(dns_header) +
1053-
strlen(question_name));
1055+
qname_len);
10541056

10551057
fprintf_eth_header(fp, eth_header);
10561058
fprintf_ip_header(fp, ip_header);

src/probe_modules/module_dnsx.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ static int index_questions_x = 0;
119119
* (below, and setup_qtype_str_map_x())
120120
*/
121121
const char *qtype_strs_x[] = {"A", "NS", "CNAME", "SOA", "PTR",
122-
"MX", "TXT", "AAAA", "RRSIG", "ANY",
123-
"SIG", "SRV", "DS", "DNSKEY", "TLSA",
124-
"SVCB", "HTTPS", "CAA", "HTTPSSVC"};
122+
"MX", "TXT", "AAAA", "RRSIG", "ANY",
123+
"SIG", "SRV", "DS", "DNSKEY", "TLSA",
124+
"SVCB", "HTTPS", "CAA", "HTTPSSVC"};
125125
const int qtype_strs_len_x = 19;
126126

127127
const dns_qtype qtype_strid_to_qtype_x[] = {
@@ -1081,9 +1081,11 @@ void dnsx_print_packet(FILE *fp, void *packet) {
10811081
uint16_t bytes_consumed = 0;
10821082
char *question_name = get_name_x(data, data_len, (char *) dns_header_p,
10831083
udp_len, &bytes_consumed);
1084+
char *qname = ((char *) dns_header_p) + sizeof(dns_header);
1085+
int qname_len = strlen(qname) + 1;
10841086
dns_question_tail *tail_p =
10851087
(dns_question_tail *) ((char *) dns_header_p + sizeof(dns_header) +
1086-
strlen(question_name));
1088+
qname_len);
10871089

10881090
fprintf_eth_header(fp, eth_header);
10891091
fprintf_ip_header(fp, ip_header);

src/probe_modules/module_dnsz.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static int index_questions_z = 0;
118118
* (below, and setup_qtype_str_map_z())
119119
*/
120120
const char *qtype_strs_z[] = {"A", "NS", "CNAME", "SOA", "PTR",
121-
"MX", "TXT", "AAAA", "RRSIG", "ANY"};
121+
"MX", "TXT", "AAAA", "RRSIG", "ANY"};
122122
const int qtype_strs_len_z = 10;
123123

124124
const dns_qtype qtype_strid_to_qtype_z[] = {
@@ -1038,9 +1038,11 @@ void dnsz_print_packet(FILE *fp, void *packet) {
10381038
uint16_t bytes_consumed = 0;
10391039
char *question_name = get_name_z(data, data_len, (char *) dns_header_p,
10401040
udp_len, &bytes_consumed);
1041+
char *qname = ((char *) dns_header_p) + sizeof(dns_header);
1042+
int qname_len = strlen(qname) + 1;
10411043
dns_question_tail *tail_p =
10421044
(dns_question_tail *) ((char *) dns_header_p + sizeof(dns_header) +
1043-
strlen(question_name));
1045+
qname_len);
10441046

10451047
fprintf_eth_header(fp, eth_header);
10461048
fprintf_ip_header(fp, ip_header);

0 commit comments

Comments
 (0)