Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regression and add L2 security module to cmake #4

Open
wants to merge 2 commits into
base: pr_openwsn_riot
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bsp/boards/python/setup.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ openwsn_module = Extension(
('OPENWSN_UDP_C', '${OPENWSN_UDP_C}'),
('OPENWSN_ICMPV6ECHO_C', '${OPENWSN_ICMPV6ECHO_C}'),
('OPENWSN_6LO_FRAGMENTATION_C', '${OPENWSN_6LO_FRAGMENTATION_C}'),
('OPENWSN_IEEE802154E_SECURITY_C', '${OPENWSN_IEEE802154E_SECURITY_C}'),

# stack configuration
('ADAPTIVE_MSF', '${ADAPTIVE_MSF}'),
Expand Down
8 changes: 8 additions & 0 deletions cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,11 @@ if (PRINTF)
else ()
set(BOARD_OPENSERIAL_PRINTF "0")
endif ()

option(L2_SECURITY "Enable link-layer security" OFF)
if (L2_SECURITY)
add_definitions(-DOPENWSN_IEEE802154E_SECURITY_C)
set(OPENWSN_IEEE802154E_SECURITY_C "1")
else ()
set(OPENWSN_IEEE802154E_SECURITY_C "0")
endif()
2 changes: 1 addition & 1 deletion stack/02a-MAClow/IEEE802154_security.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ void IEEE802154_security_retrieveAuxiliarySecurityHeader(QueueEntry_t *msg, ieee
uint8_t temp8b;
uint8_t i;
uint8_t receivedASN[5];
macFrameCounter_t l2_frameCounter;
asn_t l2_frameCounter;

// retrieve the Security Control field
// 1byte, Security Control Field
Expand Down
2 changes: 1 addition & 1 deletion stack/03b-IPv6/forwarding.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ owerror_t forwarding_send_internal_RoutingTable(
open_addr_t temp_prefix64btoWrite;

// retrieve the next hop from the routing table
if (msg->is_cjoin_response || msg->creator == COMPONENT_CJOIN) {
if (packetfunctions_isLinkLocal(&msg->l3_destinationAdd)) {
if (neighbors_isStableNeighbor(&(msg->l3_destinationAdd)) || msg->is_cjoin_response) {
// IP destination is 1-hop neighbor, send directly
packetfunctions_ip128bToMac64b(&(msg->l3_destinationAdd), &temp_prefix64btoWrite,
Expand Down