Skip to content

Commit 88bb7cc

Browse files
correct interface passed to address compare. (ARMmbed#1768)
1 parent 53949a4 commit 88bb7cc

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

source/6LoWPAN/Thread/thread_extension_bbr.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -454,11 +454,12 @@ static int thread_pbbr_bb_qry_cb(int8_t service_id, uint8_t source_address[16],
454454

455455
link_configuration_s *link_configuration_ptr = thread_joiner_application_get_config(this->interface_id);
456456
protocol_interface_info_entry_t *cur = protocol_stack_interface_info_get_by_id(this->interface_id);
457+
protocol_interface_info_entry_t *backbone_if = protocol_stack_interface_info_get_by_id(this->backbone_interface_id);
457458

458-
if (!link_configuration_ptr || !cur) {
459+
if (!link_configuration_ptr || !cur || !backbone_if) {
459460
return -1;
460461
}
461-
if (addr_interface_address_compare(cur, source_address) == 0) {
462+
if (addr_interface_address_compare(backbone_if, source_address) == 0) {
462463
// Received from own address no need to process
463464
return 0;
464465
}
@@ -584,11 +585,12 @@ static int thread_pbbr_bb_ans_cb(int8_t service_id, uint8_t source_address[16],
584585
}
585586
link_configuration_s *link_configuration_ptr = thread_joiner_application_get_config(this->interface_id);
586587
protocol_interface_info_entry_t *cur = protocol_stack_interface_info_get_by_id(this->interface_id);
588+
protocol_interface_info_entry_t *backbone_if = protocol_stack_interface_info_get_by_id(this->backbone_interface_id);
587589

588-
if (!link_configuration_ptr || !cur) {
590+
if (!link_configuration_ptr || !cur || !backbone_if) {
589591
return -1;
590592
}
591-
if (addr_interface_address_compare(cur, source_address) == 0) {
593+
if (addr_interface_address_compare(backbone_if, source_address) == 0) {
592594
// Received from own address no need to process
593595
return 0;
594596
}
@@ -1073,7 +1075,7 @@ static int thread_extension_bbr_pbbr_start(thread_pbbr_t *this)
10731075
// Generate pbbr multicast address
10741076
memset(this->pbbr_multicast_address, 0, 16);
10751077
this->pbbr_multicast_address[0] = 0xff;
1076-
this->pbbr_multicast_address[1] = 0x30 | 3; //Thread specification says p and t bits are 1 Scope is should be 2
1078+
this->pbbr_multicast_address[1] = 0x32; //Thread specification says p and t bits are 1
10771079
this->pbbr_multicast_address[2] = 0x00; //Reserved
10781080
this->pbbr_multicast_address[3] = 0x40; //Prefix length 64 bits
10791081
thread_extension_network_prefix_get(cur->id, NULL, &this->pbbr_multicast_address[4], NULL);

0 commit comments

Comments
 (0)