Skip to content

Commit 7990fa9

Browse files
Juha Heiskanenjuhhei01
authored andcommitted
Fix data for 6lowpan when mle is disabled.
Change-Id: I13d7af968f3bc88d5d338688449e1da60f1a5f8d
1 parent 501a612 commit 7990fa9

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

source/6LoWPAN/adaptation_interface.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
#endif
4646
#include "6LoWPAN/ws/ws_common.h"
4747
#include "Service_Libs/mac_neighbor_table/mac_neighbor_table.h"
48+
#include "6LoWPAN/Thread/thread_common.h"
49+
#include "6LoWPAN/ws/ws_common.h"
4850

4951
#define TRACE_GROUP "6lAd"
5052

@@ -1160,14 +1162,19 @@ static bool mac_data_is_broadcast_addr(const sockaddr_t *addr)
11601162

11611163
static bool mcps_data_indication_neighbor_validate(protocol_interface_info_entry_t *cur, const sockaddr_t *addr)
11621164
{
1163-
mac_neighbor_table_entry_t * neighbor = mac_neighbor_table_address_discover(mac_neighbor_info(cur), addr->address + 2, addr->addr_type);
1164-
if (neighbor && (neighbor->connected_device || neighbor->trusted_device)) {
1165+
if (thread_info(cur) || ws_info(cur) || (cur->lowpan_info & INTERFACE_NWK_BOOTSRAP_MLE)) {
1166+
mac_neighbor_table_entry_t * neighbor = mac_neighbor_table_address_discover(mac_neighbor_info(cur), addr->address + 2, addr->addr_type);
1167+
if (neighbor && (neighbor->connected_device || neighbor->trusted_device)) {
1168+
return true;
1169+
}
1170+
1171+
/* Otherwise, we don't know them */
1172+
return false;
1173+
} else {
1174+
//6lowpan without MLE don't can't do validation
11651175
return true;
11661176
}
11671177

1168-
/* Otherwise, we don't know them */
1169-
return false;
1170-
11711178
}
11721179

11731180
void lowpan_adaptation_interface_data_ind(protocol_interface_info_entry_t *cur, const mcps_data_ind_t *data_ind)

test/nanostack/unittest/stub/ws_common_stub.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,14 @@ void ws_common_seconds_timer(protocol_interface_info_entry_t *cur, uint32_t seco
3737
return;
3838
}
3939

40+
void ws_common_fast_timer(protocol_interface_info_entry_t *cur, uint16_t ticks)
41+
{
42+
(void) cur;
43+
(void) ticks;
44+
45+
return;
46+
}
47+
4048
int8_t ws_common_regulatory_domain_config(protocol_interface_info_entry_t *cur)
4149
{
4250
return ws_common_stub.int8_value;

0 commit comments

Comments
 (0)