mirror of
https://github.com/NLnetLabs/unbound.git
synced 2024-09-21 06:37:08 +00:00
Apply suggestions from code review
Co-authored-by: Willem Toorop <willem@nlnetlabs.nl>
This commit is contained in:
parent
24e39a09a8
commit
21c5aadbcd
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user