Skip to content

Commit 9f85599

Browse files
author
Kari Severinkangas
authored
Security bits handled correctly (#1642)
1 parent 9e6c3a1 commit 9f85599

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

source/6LoWPAN/Thread/thread_extension.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464

6565
#define TRACE_GROUP "comm"
6666

67-
#define SECURITY_POLICY_CCM_ENABLED 0x04 /* Thread Commercial Commissioning Mode is enabled when this bit is set. This is Thread 1.2 feature. */
67+
#define SECURITY_POLICY_CCM_DISABLED 0x04 /* Thread Commercial Commissioning Mode is enabled when this bit is set. This is Thread 1.2 feature. */
6868

6969
typedef struct thread_extension_info {
7070
int8_t coap_service_id;
@@ -581,7 +581,7 @@ bool thread_extension_enabled(protocol_interface_info_entry_t *cur)
581581
}
582582
uint16_t securityPolicy = thread_joiner_application_security_policy_get(cur->id);
583583

584-
if (securityPolicy & SECURITY_POLICY_CCM_ENABLED) {
584+
if (!(securityPolicy & SECURITY_POLICY_CCM_DISABLED)) {
585585
return true;
586586
}
587587

@@ -620,11 +620,9 @@ void thread_extension_discover_response_read(discovery_response_list_t *nwk_info
620620

621621
void thread_extension_discover_response_tlv_write(uint16_t *data, uint8_t version, uint16_t securityPolicy)
622622
{
623-
624-
if (version == 3 && !(securityPolicy & SECURITY_POLICY_CCM_ENABLED)) {
623+
if (version == 3 && !(securityPolicy & SECURITY_POLICY_CCM_DISABLED)) {
625624
*data |= (uint16_t) (1 << 10);
626625
}
627-
return;
628626
}
629627

630628
#ifdef HAVE_THREAD_ROUTER

0 commit comments

Comments
 (0)