diff --git a/src/net.c b/src/net.c index c7c08c50..27a1ca1a 100644 --- a/src/net.c +++ b/src/net.c @@ -1325,8 +1325,12 @@ no_response(coap_pdu_t *request, coap_pdu_t *response) { val = coap_decode_var_bytes(coap_opt_value(nores), coap_opt_length(nores)); } - return (COAP_RESPONSE_CLASS(request->hdr->code) > 0) - && (((2 << (COAP_RESPONSE_CLASS(request->hdr->code) - 1)) & val) > 0); + debug("response class is %d (bit %d), val is %02x\n", + COAP_RESPONSE_CLASS(response->hdr->code), + (1 << (COAP_RESPONSE_CLASS(response->hdr->code) - 1)), + val); + return (COAP_RESPONSE_CLASS(response->hdr->code) > 0) + && (((1 << (COAP_RESPONSE_CLASS(response->hdr->code) - 1)) & val) > 0); } #define WANT_WKC(Pdu,Key) \