diff --git a/sys/net/application_layer/coap/gcoap.c b/sys/net/application_layer/coap/gcoap.c index f0a27d9d03..86301d02a3 100644 --- a/sys/net/application_layer/coap/gcoap.c +++ b/sys/net/application_layer/coap/gcoap.c @@ -135,7 +135,7 @@ static void _listen(sock_udp_t *sock) return; } - if (coap_get_code(&pdu) == COAP_CODE_EMPTY) { + if (pdu.hdr->code == COAP_CODE_EMPTY) { DEBUG("gcoap: empty messages not handled yet\n"); return; @@ -159,6 +159,7 @@ static void _listen(sock_udp_t *sock) _find_req_memo(&memo, &pdu, buf, sizeof(buf)); if (memo) { xtimer_remove(&memo->response_timer); + memo->state = GCOAP_MEMO_RESP; memo->resp_handler(memo->state, &pdu); memo->state = GCOAP_MEMO_UNUSED; }