Skip to content

Commit 7544ef3

Browse files
added response to confirmable unicast. (ARMmbed#1722)
1 parent a8a5a90 commit 7544ef3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

source/6LoWPAN/Thread/thread_extension_bbr.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,7 @@ static int thread_pbbr_dua_duplicate_address_detection(int8_t service_id, uint8_
553553
}
554554
ipv6_route_delete(route->prefix, route->prefix_len, this->interface_id, NULL, ROUTE_THREAD_PROXIED_DUA_HOST);
555555
}
556+
556557
return 0;
557558
}
558559

@@ -592,9 +593,18 @@ static int thread_pbbr_bb_ans_cb(int8_t service_id, uint8_t source_address[16],
592593

593594
if ( addr_len < 16|| ml_eid_len < 8 || last_transaction_time_len < 4 ) {
594595
tr_err("Invalid message");
596+
// send confirmation with not acceptable status code
597+
if (request_ptr->msg_type == COAP_MSG_TYPE_CONFIRMABLE) {
598+
coap_service_response_send(service_id, COAP_REQUEST_OPTIONS_NONE, request_ptr, COAP_MSG_CODE_RESPONSE_NOT_ACCEPTABLE, COAP_CT_OCTET_STREAM, NULL, 0);
599+
}
595600
return 0;
596601
}
597602

603+
// when we process unicast b/ba req send confirmation
604+
if (request_ptr->msg_type == COAP_MSG_TYPE_CONFIRMABLE) {
605+
coap_service_response_send(service_id, COAP_REQUEST_OPTIONS_NONE, request_ptr, COAP_MSG_CODE_RESPONSE_CHANGED, COAP_CT_OCTET_STREAM, NULL, 0);
606+
}
607+
598608
if ((thread_pbbr_dua_duplicate_address_detection(service_id, addr_data_ptr, ml_eid_ptr) == 0)) {
599609
return 0;
600610
}

0 commit comments

Comments
 (0)