uint8_t *a = answer_ptr;
ssize_t resp_size;
- if (rr == NULL || rr->type != ns_t_a) {
- RWRAP_LOG(RWRAP_LOG_ERROR,
- "Malformed record, no or wrong value!\n");
+ if (rr->type != ns_t_a) {
+ RWRAP_LOG(RWRAP_LOG_ERROR, "Wrong type!\n");
return -1;
}
RWRAP_LOG(RWRAP_LOG_TRACE, "Adding A RR");
uint8_t *a = answer;
ssize_t resp_size;
- if (rr == NULL || rr->type != ns_t_aaaa) {
- RWRAP_LOG(RWRAP_LOG_ERROR,
- "Malformed record, no or wrong value!\n");
+ if (rr->type != ns_t_aaaa) {
+ RWRAP_LOG(RWRAP_LOG_ERROR, "Wrong type!\n");
return -1;
}
RWRAP_LOG(RWRAP_LOG_TRACE, "Adding AAAA RR");
unsigned char hostname_compressed[MAXDNAME];
ssize_t compressed_len;
- if (rr == NULL || rr->type != ns_t_ns) {
- RWRAP_LOG(RWRAP_LOG_ERROR,
- "Malformed record, no or wrong value!\n");
+ if (rr->type != ns_t_ns) {
+ RWRAP_LOG(RWRAP_LOG_ERROR, "Wrong type!\n");
return -1;
}
RWRAP_LOG(RWRAP_LOG_TRACE, "Adding NS RR");
unsigned char hostname_compressed[MAXDNAME];
ssize_t compressed_len;
- if (rr == NULL || rr->type != ns_t_srv) {
- RWRAP_LOG(RWRAP_LOG_ERROR,
- "Malformed record, no or wrong value!\n");
+ if (rr->type != ns_t_srv) {
+ RWRAP_LOG(RWRAP_LOG_ERROR, "Wrong type!\n");
return -1;
}
RWRAP_LOG(RWRAP_LOG_TRACE, "Adding SRV RR");
unsigned char uri_compressed[MAXDNAME];
ssize_t compressed_len;
- if (rr == NULL || rr->type != ns_t_uri) {
- RWRAP_LOG(RWRAP_LOG_ERROR,
- "Malformed record, no or wrong value!\n");
+ if (rr->type != ns_t_uri) {
+ RWRAP_LOG(RWRAP_LOG_ERROR, "Wrong type!\n");
return -1;
}
RWRAP_LOG(RWRAP_LOG_TRACE, "Adding URI RR");
unsigned char mailbox_compressed[MAXDNAME];
ssize_t compressed_mb_len;
- if (rr == NULL || rr->type != ns_t_soa) {
- RWRAP_LOG(RWRAP_LOG_ERROR,
- "Malformed record, no or wrong value!\n");
+ if (rr->type != ns_t_soa) {
+ RWRAP_LOG(RWRAP_LOG_ERROR, "Wrong type!\n");
return -1;
}
RWRAP_LOG(RWRAP_LOG_TRACE, "Adding SOA RR");
unsigned char hostname_compressed[MAXDNAME];
ssize_t rdata_size;
- if (rr == NULL || rr->type != ns_t_cname) {
- RWRAP_LOG(RWRAP_LOG_ERROR,
- "Malformed record, no or wrong value!\n");
+ if (rr->type != ns_t_cname) {
+ RWRAP_LOG(RWRAP_LOG_ERROR, "Wrong type!\n");
return -1;
}
RWRAP_LOG(RWRAP_LOG_TRACE, "Adding CNAME RR");
{
ssize_t resp_data;
+ if (rr == NULL) {
+ RWRAP_LOG(RWRAP_LOG_ERROR, "Internal error!\n");
+ return -1;
+ }
+
switch (rr->type) {
case ns_t_a:
resp_data = rwrap_fake_a(rr, answer, anslen);