Skip to content

Commit ec00a16

Browse files
committed
nanocoap: ensure pkt->hdr equals rbuf in coap_build_reply()
1 parent d48eaf1 commit ec00a16

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sys/net/application_layer/nanocoap/nanocoap.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,9 @@ ssize_t coap_build_reply(coap_pkt_t *pkt, unsigned code,
778778
ntohs(pkt->hdr->id));
779779
len += payload_len;
780780

781+
/* HACK: many CoAP handlers assume that the pkt buffer is also used for the response */
782+
pkt->hdr = (void *)rbuf;
783+
781784
return len;
782785
}
783786

0 commit comments

Comments
 (0)