openthread icon indicating copy to clipboard operation
openthread copied to clipboard

[mle] fix processing of CSL TLVs

Open abtink opened this issue 3 years ago • 2 comments

This commit contains fixes and enhancements related to processing of CSL Channel TLV and CSL Clock Accuracy TLV in MLE messages:

  • Updates/adds IsValid() method to check if TLV is well-formed. In particular, we check the TLV length to be at least the expecte length (but can be larger) to allow for future changes to the TLV format (adding new fields while remaining backward compatible).

  • Ensure to verify that the read TLV is valid before using its content.

  • Fix processing of Accuracy TLV in HandleChildUpdateResponse() (where we could use incorrect values if TLV was not present).

abtink avatar Aug 09 '22 18:08 abtink

Codecov Report

Merging #8004 (308f683) into main (ba14836) will decrease coverage by 0.00%. The diff coverage is 71.42%.

@@            Coverage Diff             @@
##             main    #8004      +/-   ##
==========================================
- Coverage   85.44%   85.43%   -0.01%     
==========================================
  Files         505      505              
  Lines       70093    70103      +10     
==========================================
+ Hits        59888    59892       +4     
- Misses      10205    10211       +6     
Impacted Files Coverage Δ
src/core/thread/mle_router.cpp 85.57% <50.00%> (-0.26%) :arrow_down:
src/core/thread/mle.cpp 89.39% <81.81%> (+0.04%) :arrow_up:
src/core/thread/mle_tlvs.hpp 100.00% <100.00%> (ø)
src/core/thread/mesh_forwarder.cpp 87.73% <0.00%> (-0.62%) :arrow_down:
src/lib/spinel/radio_spinel_impl.hpp 85.95% <0.00%> (-0.39%) :arrow_down:
src/core/thread/router_table.cpp 92.93% <0.00%> (-0.36%) :arrow_down:
src/posix/platform/hdlc_interface.cpp 51.49% <0.00%> (-0.34%) :arrow_down:
src/core/mac/mac.cpp 89.57% <0.00%> (-0.30%) :arrow_down:
src/core/coap/coap.cpp 79.77% <0.00%> (ø)
... and 7 more

codecov[bot] avatar Aug 09 '22 19:08 codecov[bot]

Size Report of OpenThread

Merging #8004 into main(ba14836b68e7eb8a00248f31bbd65a9a3edfb320).

name branch text data bss total
ot-cli-ftd_1.1 main 462496 780 60772 524048
#8004 462528 780 60772 524080
+/- +32 0 0 +32
ot-cli-mtd_1.1 main 381904 780 50564 433248
#8004 381904 780 50564 433248
+/- 0 0 0 0
ot-ncp-ftd_1.1 main 444220 780 59752 504752
#8004 444252 780 59752 504784
+/- +32 0 0 +32
ot-ncp-mtd_1.1 main 366372 780 49544 416696
#8004 366372 780 49544 416696
+/- 0 0 0 0
ot-rcp_1.1 main 58136 564 19964 78664
#8004 58136 564 19964 78664
+/- 0 0 0 0
libopenthread-cli-ftd.a_1.1 main 45925 0 4244 50169
#8004 45925 0 4244 50169
+/- 0 0 0 0
libopenthread-cli-mtd.a_1.1 main 38548 0 4244 42792
#8004 38548 0 4244 42792
+/- 0 0 0 0
libopenthread-ftd.a_1.1 main 242862 20 39090 281972
#8004 242882 20 39090 281992
+/- +20 0 0 +20
libopenthread-mtd.a_1.1 main 175930 20 28882 204832
#8004 175930 20 28882 204832
+/- 0 0 0 0
libopenthread-ncp-ftd.a_1.1 main 31597 0 5852 37449
#8004 31597 0 5852 37449
+/- 0 0 0 0
libopenthread-ncp-mtd.a_1.1 main 26441 0 5852 32293
#8004 26441 0 5852 32293
+/- 0 0 0 0
libopenthread-rcp.a_1.1 main 8894 0 4988 13882
#8004 8894 0 4988 13882
+/- 0 0 0 0
libopenthread-radio.a_1.1 main 15939 0 174 16113
#8004 15939 0 174 16113
+/- 0 0 0 0
ot-cli-ftd_1.3 main 485280 780 70468 556528
#8004 485296 780 70468 556544
+/- +16 0 0 +16
ot-cli-mtd_1.3 main 397072 780 51820 449672
#8004 397072 780 51820 449672
+/- 0 0 0 0
ot-ncp-ftd_1.3 main 465964 780 69440 536184
#8004 465980 780 69440 536200
+/- +16 0 0 +16
ot-ncp-mtd_1.3 main 380124 780 50792 431696
#8004 380124 780 50792 431696
+/- 0 0 0 0
ot-rcp_1.3 main 60464 564 20532 81560
#8004 60464 564 20532 81560
+/- 0 0 0 0
libopenthread-cli-ftd.a_1.3 main 48783 0 4244 53027
#8004 48783 0 4244 53027
+/- 0 0 0 0
libopenthread-cli-mtd.a_1.3 main 40812 0 4244 45056
#8004 40812 0 4244 45056
+/- 0 0 0 0
libopenthread-ftd.a_1.3 main 261802 20 48242 310064
#8004 261818 20 48242 310080
+/- +16 0 0 +16
libopenthread-mtd.a_1.3 main 187773 20 29594 217387
#8004 187773 20 29594 217387
+/- 0 0 0 0
libopenthread-ncp-ftd.a_1.3 main 33427 0 5852 39279
#8004 33427 0 5852 39279
+/- 0 0 0 0
libopenthread-ncp-mtd.a_1.3 main 27807 0 5852 33659
#8004 27807 0 5852 33659
+/- 0 0 0 0
libopenthread-rcp.a_1.3 main 9060 0 4988 14048
#8004 9060 0 4988 14048
+/- 0 0 0 0
libopenthread-radio.a_1.3 main 16819 0 206 17025
#8004 16819 0 206 17025
+/- 0 0 0 0

size-report[bot] avatar Aug 09 '22 19:08 size-report[bot]