Commit ae1fbbd3 authored by Karel Slaný's avatar Karel Slaný Committed by Ondřej Surý

Renamed function with confusing name.

parent 5d7d52d4
......@@ -243,7 +243,7 @@ int kr_pkt_set_ext_rcode(knot_pkt_t *pkt, uint16_t whole_rcode)
return kr_ok();
}
uint8_t *kr_is_cookie_query(const knot_pkt_t *pkt)
uint8_t *kr_no_question_cookie_query(const knot_pkt_t *pkt)
{
if (!pkt || knot_wire_get_qdcount(pkt->wire) > 0) {
return false;
......
......@@ -68,12 +68,14 @@ KR_EXPORT
int kr_pkt_set_ext_rcode(knot_pkt_t *pkt, uint16_t whole_rcode);
/**
* @brief Check whether packet is a server cookie request.
* @brief Check whether packet is a server cookie request according to
* RFC7873 5.4.
* @param pkt Packet to be examined.
* @return Pointer to entire cookie option if is a cookie query, NULL else.
* @return Pointer to entire cookie option if is a server cookie query, NULL on
* errors or if packet doesn't contain cookies or if QDCOUNT > 0.
*/
KR_EXPORT
uint8_t *kr_is_cookie_query(const knot_pkt_t *pkt);
uint8_t *kr_no_question_cookie_query(const knot_pkt_t *pkt);
/**
* @brief Parse cookies from cookie option.
......
......@@ -462,7 +462,7 @@ static int resolve_query(struct kr_request *request, const knot_pkt_t *packet)
* The layers don't expect to handle queries with QDCOUNT != 1
* so such queries are handled directly here. */
struct knot_dns_cookies cookies = { 0, };
uint8_t *cookie_opt = kr_is_cookie_query(packet);
uint8_t *cookie_opt = kr_no_question_cookie_query(packet);
if (cookie_opt && request->ctx->cookie_ctx.clnt.enabled) {
if (kr_ok() != kr_parse_cookie_opt(cookie_opt,
&cookies)) {
......
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