Apply suggestions from code review

Co-authored-by: Willem Toorop <willem@nlnetlabs.nl>
This commit is contained in:
TCY16 2021-05-21 16:09:18 +02:00 committed by GitHub
parent 24e39a09a8
commit 21c5aadbcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -1077,8 +1077,8 @@ sldns_str2wire_svcbparam_ipv4hint(const char* val, uint8_t* rd, size_t* rd_len)
ip_wire_dst++;
count--;
}
// if (count) /* verify that we parsed all values */
// ERROR "Could not parse ipv4hint SvcParamValue: "
if (count) /* verify that we parsed all values */
return LDNS_WIREPARSE_ERR_SYNTAX_IP4;
return LDNS_WIREPARSE_ERR_OK;
}

View File

@ -984,14 +984,14 @@ sldns_wire2str_svcparam_ipv4hint2str(char** s,
return 0; /* wireformat error, incorrect size or inet family */
w += sldns_str_print(s, slen, "=%s", ip_str);
data += LDNS_IP4ADDRLEN / sizeof(uint16_t);
data += LDNS_IP4ADDRLEN;
while ((data_len -= LDNS_IP4ADDRLEN) > 0) {
if (inet_ntop(AF_INET, data, ip_str, sizeof(ip_str)) == NULL)
return 0; /* wireformat error, incorrect size or inet family */
w += sldns_str_print(s, slen, ",%s", ip_str);
data += LDNS_IP4ADDRLEN / sizeof(uint16_t);
data += LDNS_IP4ADDRLEN;
}
}