Commit Graph

39 Commits (1768ad9e5f686e534c751fb4453bc4fd64466e8c)

Author SHA1 Message Date
Martin Kojtal 1768ad9e5f
Merge pull request #15406 from IVOES/fix-null-check
Fix null pointer dereferencing
2023-05-22 11:35:15 +01:00
Mingjie Shen 378f2f579d Fix null pointer dereferencing
Add null check for return values of functions that are mostly (but not
always) checked for null.
E.g., since 98% of calls to protocol_stack_interface_info_get_by_id
check for null, it is likely that the function can return null values in
some cases, and omitting the check could crash the program.
2023-04-20 00:54:47 -04:00
Mingjie Shen 1b77cda621 Change storage-class of secret_buf to static
Storing the address of a local variable (`secret_buf`)
in non-local memory (`prf_ptr->secret`) can cause a
dangling pointer bug if the address is used after the function returns.
2023-04-19 17:07:42 -04:00
YannCharbon b8b638dd41 Fix default interface ID only being used partially
If user sets the default interface ID for a socket (e.g. using setsockopt
with SOCKET_INTERFACE_SELECT), the default interface should take over
other interface selection mechanisms as a interface is bound to the socket.
This applies for both IPv6 local and global scopes for unicast messages
but not for multicast messages as these are bound to a multicast interface
using SOCKET_IPV6_MULTICAST_IF socket option.
2023-01-10 18:45:39 +01:00
YannCharbon 0d2badf42c Add complete support of DHCP relay interface ID option
RFC3315 specifies the following: "The relay agent MAY send the Interface-id
option to identify the interface on which the client message was received.
If a relay agent  receives a Relay-reply message with an Interface-id
option, the relay agent relays the message to the client through the
interface identified by the option."

The current implementation of the DHCP relay reply handling, the interface
ID field from the server response is ignored. Managing the interface ID
is very important especially as DHCP requests/replies use link-local
addresses. The consequence of this is that the interface must always be
specified because the routing layer cannot guess the correct interface.
Moreover, Mbed provides a mechanism to enable/disable the interface ID
option on a DHCP relay instance, so it is important to fully support it.

The reason why this issue has not been discoverd until now is that the DHCP
relay is mainly used on systems that use only one interface (such as Wi-SUN
routers). By default, when no interface ID is specified for the socket, the
latter will choose 6loWPAN interface by default. This means that if two
interfaces are used on the same device, the 6loWPAN interface is always
selected.

The commit adds code to retrieve the interface-id value contained within
the DHCP relay reply message and write it to a control message header
that is added to the socket message. This tells the socket which
interface to choose. If the interface-id option is not enabled on the
relay, this procedure is simply ignored.
2022-08-30 17:49:41 +02:00
Arto Kinnunen 0dfb79e28b Merge commit '00253cb11629fab6f753682d89faa2ce7b4a213a' into nanostack_v15_1_0
* commit '00253cb11629fab6f753682d89faa2ce7b4a213a':
  Squashed 'connectivity/nanostack/sal-stack-nanostack/' changes from 225a4af94f..154db5425e
2021-12-08 13:41:33 +02:00
Jarkko Paso d125480ede Updated 6LoWPAN/CMakeLists.txt 2021-09-29 21:23:04 +03:00
Arto Kinnunen c8aafa7145 Update Nanostack CMakeLists.txt
Add new files to the CMakeLists.txt
2021-09-23 14:24:02 +03:00
Arto Kinnunen b1adec9028 Merge commit 'fa7202c2e699b26a024d38657a6e495e073fea07'
* commit 'fa7202c2e699b26a024d38657a6e495e073fea07':
  Squashed 'connectivity/nanostack/sal-stack-nanostack/' changes from 4a3c5c525b..225a4af94f
2021-09-23 13:13:36 +03:00
Arto Kinnunen fa7202c2e6 Squashed 'connectivity/nanostack/sal-stack-nanostack/' changes from 4a3c5c525b..225a4af94f
225a4af94f Remove files from tests folder
58d2c8fa82 Merge remote-tracking branch 'origin/release_internal' into release_external
921b4b3273 Wi-SUN FAN 1.1 dynamic MDR data request enabler
b8722e81b1 Corrected BR removing of waiting list entry when supplicant is in key storage
0d54d7ab39 Adjust trace levels (#2692)
681d9eae8d Added reset for pan id and version to BR network start
30d4fb2ed9 Renaming and cleaning ws bootstrap (#2688)
e0da19dbf0 Add Wi-SUN host configuration (#2690)
50ecc3d0f0 Refactoring Wi-SUN stack (#2686)
9d2386d484 Renamed operation mode to operating mode.
2f755bcfdb RF config resolver and some refactoring (#2683)
86c6d19e06 Fixed WS IE PCAP read operation wrong length usage.
cd3a4c2a62 Config: Remove additional HAVE_WS_ROUTER (#2684)
cdd7f2d868 Added API for configure supported Phy capability.
a00a3c0a02 Wi-SUN FAN 1.1 PCAP IE update
2d063d3b4a Moved State machine and timer functions to own files
edb8bec609 Corrected system time check function return values
85358a635b Moved Wi-SUN Bootstrap Event handling to separate device handlers
61cbdde485 MAC to support mode switch on single channel (#2678)
1006d29e4d Added storing of PAN ID to NVM in BBR
7bf0028c66 Corrected system time jump detection on BR startup
e60974d815 Split Wi-SUN bootstrap to device types
a3f341266e MAC data req: API to support mode switch (#2674)
cad5122a90 Removed automatic network size configuration (#2673)
35d313224a MAC: Callback set to resolve PHY mode ID (#2672)
0c5faca469 Added support for large system time changes (e.g. due to NTP) (#2670)
c94b306431 LFN version and LGTK Hash IE advertisment and learn
8e075119f6 Use FAN version constant  instead of pure number
a5566b22b2 Channel Plan 2 validation and FAN 1.0 reject
42dba4151e Wi-Sun IE FAN 1.1 update
1d56070c24 EU channel plan ids (FAN 1.1) supported (#2668)
fc4f41fb30 Add test API empty function
37efc7ec25 Add version 1.1 basic support
e1558fbb1a Implemented mode switch PHR build and parse (#2665)
cbd8a15d31 Corrected frame counter storing threshold check
37f7ae95eb Time configuration distribution using DHCPv6 vendor data
7415bc724b Added checks for Border Router frame counter space exhaustion (#2660)
f1a65ecbe8 Mode switch PHY API (#2663)
e54231b5d4 Do not check buffer age when virtual RF driver used (#2662)
cc8c7bd38f arm_network_certificate_chain_set() returns -2 when PANA is disabled
319dd91bce Fix dubious semicolon in #define
2ff51abeca Remove extra '\n' in traces
19376c8837 Simplify array indexes
c808661836 Fix ASAN warnings about overflows in bit shifts
f998008f60 Fix use-after-free in mac_helper_coordinator_address_set()
4d04541d70 Wi-SUN header and Paylod IE element lenght future proof update.
935898badf Medium network PAN_TIMEOUT changed to 30 minutes
1af7cfeb24 Updated nanostack to be compatible with mbed TLS 3.0 (#2657)
29744e0e46 If Router Solicitation creation fails no longer tries to retry the RS right away (#2655)
2b889e92b0 Added automatic test procedure triggering during bootstrap
ed9eb0503f GTKs are removed only when fresh GTK hash is received
81ecdc24f8 Added empty function for test procedure trigger
14439b4aa9 Added support for triggering test procedures
b8a67a9e36 Update CHANGELOG.md for Nanostack 14.0.0 (#2649)

git-subtree-dir: connectivity/nanostack/sal-stack-nanostack
git-subtree-split: 225a4af94f3faf5ca3726e86bc96cdda4c99a469
2021-09-23 13:04:04 +03:00
Arto Kinnunen 9913b59901 Update file path in CMakeLists.txt
Folder 'protocols' was missing from the file path.
2021-06-29 17:50:43 +03:00
Arto Kinnunen b3cced7d7f Update sal-stack-nanostack CMakeLists
Add new files to CMakeLists.txt
2021-06-28 09:38:49 +03:00
Arto Kinnunen 3b9a9c7fe3 Squashed 'connectivity/nanostack/sal-stack-nanostack/' changes from 0903b819c5..4a3c5c525b
4a3c5c525b Merge remote-tracking branch 'origin/release_internal' into release_external
2b8d2e1356 Do not reset radio when MAC data request timeouts (#2647)
95c506a276 Frame counters for nw keys are now stored to NVM only after send key is set (#2641)
3b3010a79b Adjusted stagger random to [min,min+max] and for small nw set the stagger value to 10 seconds
02bc33a242 Adjusted security protocol (EAP-TLS,4WH,2WH) retry timers
eb26726020 High Priority timestamp compare overflow support fix.
928723a33e FHSS WS: Initialize broadcast channel count when enabling FHSS (#2642)
6040d703c8 Updated change log
667b191223 Changed initial EAPOL-key retries from trickle to exponential backup
d925145d33 Add RTT calculation for DHCP Time calculation
0b82953567 Traceroute bug fix.
04de6e26d8 Merge pull request #2638 from PelionIoT/mbed_os_fix_ufsi_calculation
20123477c6 Fixed FHSS UFSI calculation unit tests
436f16e84f Handle timer rollover in calculate_ufsi
411cf5c7a4 coding style
d6f44218d6 Correct ufsi timing calculation
560619d85d Add network time vendor data element to DHCPv6 reply message
6d290dc3c1 System time read/write callbacks (#2637)
7905df666d Restart or remove transmission when MAC data request timeouts (#2636)
c97695cfc6 Bug fix: EAPOL parent compare fix
e283e6285c Fixed channel mask usage with OFDM configurations (#2633)
24168f891b Do not send too old packets (#2632)
dbd83be16d Fix copyrights (#2631)
7f0cffdbf7 Merge pull request #2630 from PelionIoT/use_pelion_copyright
511bd5a3ad Corrected coding style
57ec0281a8 Corrected comparison
7d853de862 When EAPOL waiting queue is full oldest entry is removed
acf580fbd0 Update copyright in changed MDNS files
933c0bbf0a Update copyright
3aeb2af77c Statistics for data request latencies (#2629)
3f7eae64ef EAPOL FHSS temp entry discover
5200b666e7 DHCP time elapsed time write fix.
0536874f64 Removed empty EAPOL-key message send after 4WH completion to nodes on relay
8a2a683aef Fixed DHCP wrong time elapsed value write.
283f2ee685 DHCPv6 update:
99be7783ec EAPOL temp neighbour update
4f9e3d12ab Adaptation layer to remove oldest packet first
20f1f6492f Added ignoring of retry messages from RADIUS server when waiting EAP-TLS
8a8b407c47 Add RSL check for ETX Calculation for RPL parent selection
c05e1da757 Fix DHCP server Uninitialized memory read
77229eefa6 Fix CPP error from domain prefix check
7e47889111 support filtering of EAPOL parents based device-min-sens configuration
618a19192c Wi-SUN Expedite forward state update
4371462d66 Fix NULL read from RPL header addition
7802c7ee97 Update CHANGELOG.md
b2c810402c CHANGELOG for Nanostack v13.0.0 (#2615)

git-subtree-dir: connectivity/nanostack/sal-stack-nanostack
git-subtree-split: 4a3c5c525b2a62c19ecfb0ac64d09bd2a7f56ceb
2021-06-28 09:38:44 +03:00
AlbanJeantheau-silabs 3001e52216
Handle timer rollover in calculate_ufsi
Co-authored-by: Jarkko Paso <jarkko.paso@arm.com>
2021-06-11 10:39:16 +02:00
Alban Jeantheau b4b35c6a88 coding style 2021-06-11 10:35:47 +02:00
Alban Jeantheau 8187325560 Correct ufsi timing calculation
When calculating ufsi, the function was relying
on the slot processed by the unicast fhss timer
callback, which can be delayed. When it happens
the slot value is wrong, and the ufsi is incorrect.

The ufsi is then used by the peer to determined
the reply channel, so the devices are thus
unsynchronized until the next uplink packet.
2021-06-08 16:27:25 +02:00
Arto Kinnunen 2773394947 Merge commit 'fb72e8eba714116d3578e4f53010b104f48459f0' into nanostack_release_13_0_master
* commit 'fb72e8eba714116d3578e4f53010b104f48459f0':
  Squashed 'connectivity/nanostack/sal-stack-nanostack/' changes from 3183d87e41..0903b819c5
2021-04-21 10:20:07 +03:00
Arto Kinnunen 0810306ca4 Add random_early_detection to CMakeLists.txt 2021-01-20 11:43:43 +02:00
Arto Kinnunen 0c4294b1af Merge commit 'b0e699fe3e03f574aa2b6d74ff56a024d6e1d508'
* commit 'b0e699fe3e03f574aa2b6d74ff56a024d6e1d508':
  Squashed 'connectivity/nanostack/sal-stack-nanostack/' changes from 715ae9a693..3183d87e41
2021-01-19 11:53:20 +02:00
paul.szczepanek@arm.com 2e714f4b6f compile out trace when not available 2021-01-04 19:38:03 +00:00
Martin Kojtal 5cbdbcb2d2
Merge pull request #13889 from artokin/nanostack_release_12_6_2
Nanostack release v12.6.2
2020-11-11 09:11:27 +00:00
Arto Kinnunen c8c2e5437f Merge commit '48fcb2ba25d66cbcc3be602a7662306caae0f9fe'
* commit '48fcb2ba25d66cbcc3be602a7662306caae0f9fe':
  Squashed 'connectivity/nanostack/sal-stack-nanostack/' changes from 09d9e24f2d..715ae9a693
2020-11-10 13:47:13 +02:00
Hugues Kamba 794e32df74 CMake: Use relative paths to list source files and directories
The absolute path is still required for listing linker
files as they are referenced from a function in the top
level CMake input source file.
2020-11-09 12:32:30 +00:00
Hugues Kamba bf84a5b329 CMake: Rename CMake targets
* mbed-os renamed mbed-core
* mbed-os-<COMPONENT> renamed mbed-<COMPONENT>
2020-11-06 17:25:22 +00:00
Hugues Kamba fa98689639 CMake: Componentize Mbed OS into multiple CMake targets (#13732)
Aside from the core mbed-os CMake target, a number of targets have been created so they can optionally be included by application executables that require them using `target_link_libraries()`.

Co-authored-by: Martin Kojtal <martin.kojtal@arm.com>
Co-authored-by: Rajkumar Kanagaraj <rajkumar.kanagaraj@arm.com>
2020-11-06 17:25:21 +00:00
Hugues Kamba 9b8c5acb99 CMake: Fix build failure due to mbed-trace, mbed-client-randlib, and nanostack dir changes 2020-11-06 17:25:20 +00:00
Hugues Kamba ec376fb587 CMake: List missing files in sal-stack-nanostack 2020-11-06 17:25:20 +00:00
Hugues Kamba 0c8cb3134c CMake: Fix build failure due to PSA dir move 2020-11-06 17:25:20 +00:00
Hugues Kamba c30d9259e9 CMake: Fix build failure due to nanostack dir move 2020-11-06 17:25:19 +00:00
Martin Kojtal 61aa6817f0
Merge pull request #13724 from harmut01/license_refactor
Add license notice to Arm copyrighted source files
2020-10-16 09:09:53 +01:00
Harrison Mutai 4fad1112e5 Add SPDX license identifier to Arm files
Add license identifier to files which Arm owns the copyright to,
and contain either BSD-3 or Apache-2.0 licenses. This is to address
license errors raised by scancode analysis.
2020-10-15 10:47:27 +01:00
Arto Kinnunen 51b8b10e65 Merge commit 'b9f37539182bfa5002208dba6885293e17700849'
* commit 'b9f37539182bfa5002208dba6885293e17700849':
  Squashed 'connectivity/nanostack/sal-stack-nanostack/' changes from d879e6db87..09d9e24f2d
2020-10-05 15:05:30 +03:00
Arto Kinnunen b25f05b035 Merge commit '9a4e8a5964c54f2a983ffd4c13755176d4f9df52'
* commit '9a4e8a5964c54f2a983ffd4c13755176d4f9df52':
  Squashed 'connectivity/nanostack/sal-stack-nanostack/' changes from 48609aeded..d879e6db87
2020-09-07 14:38:37 +03:00
Martin Kojtal b2ac60924c
Merge pull request #13476 from talorion/bugfix/fix-warnings
Fix trivial compiler Warnings
2020-09-07 09:58:41 +01:00
talorion e3080a6e0e fixed warnings: static method defined but not used 2020-08-24 15:34:20 +02:00
Arto Kinnunen fdcb23ede2 Merge commit '4ed4c4fa20b0b14d2525e0f4e805ca1ad58579d2' into nanostack-as_subtree
* commit '4ed4c4fa20b0b14d2525e0f4e805ca1ad58579d2':
  Squashed 'connectivity/nanostack/sal-stack-nanostack/' changes from b3fe5744d1..48609aeded
2020-08-20 16:57:03 +03:00
Arto Kinnunen 2a4b474e26 Merge commit '42a7bffc528d47263f0e285bc5220324f71e9da9' as 'connectivity/nanostack/sal-stack-nanostack' 2020-08-18 12:56:22 +03:00
Arto Kinnunen a66aad9866 Nanostack: Remove existing copy of sal-stack-nanostack 2020-08-18 12:50:34 +03:00
Ashok Rao b9b4c5d392 Mbed OS will soon be changing directory structure to the below:
```
connectivity
├── netsocket
├── lwipstack
├── nanostack
│   ├── mbed_lib.json // nanostack-interface's mbed_lib.json
│   ├── include
│   │   └── nanostack // headers from features/netsocket/nanostack-interface
│   ├── source        // sources from features/netsocket/nanostack-interface
│   ├── coap-service  // used by Thread only - deprecate?
│   ├── mbed-mesh-api
│   ├── nanostack-hal-mbed-cmsis-rtos // HAL porting layer for Nanostack on mbed with CMSIS-RTOS
│   ├── sal-stack-nanostack
│   └── sal-stack-nanostack-eventloop
├── cellular                // previously in features/cellular/framework/
├── ...

```

This PR is a part of a wider \connectivity refactoring and implements the above new directory structure for \nanostack.
2020-08-05 16:55:43 +01:00