Commit 429d8cb8 authored by Daniel Salzman's avatar Daniel Salzman

mod-whoami: remove redundant check (lgtm.com)

parent 5b71169b
......@@ -59,7 +59,7 @@ static knotd_in_state_t whoami_query(knotd_in_state_t state, knot_pkt_t *pkt,
* length into 'rdata' and 'len_rdata'.
*/
const void *rdata = NULL;
size_t len_rdata = 0;
uint16_t len_rdata = 0;
if (query_source->ss_family == AF_INET && qtype == KNOT_RRTYPE_A) {
const struct sockaddr_in *sai = (struct sockaddr_in *)query_source;
rdata = &sai->sin_addr.s_addr;
......@@ -73,13 +73,6 @@ static knotd_in_state_t whoami_query(knotd_in_state_t state, knot_pkt_t *pkt,
return state;
}
/* Sanity check, since knot_rrset_add_rdata() takes a uint16_t length
* parameter.
*/
if (len_rdata > UINT16_MAX) {
return state;
}
/* Synthesize the response RRset. */
/* TTL is taken from the TTL of the SOA record. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment