Skip to content

gnrc/ipv6: Check for overflow#20771

Merged
benpicco merged 2 commits intoRIOT-OS:masterfrom
xnumad:overflow-fix
Jul 4, 2024
Merged

gnrc/ipv6: Check for overflow#20771
benpicco merged 2 commits intoRIOT-OS:masterfrom
xnumad:overflow-fix

Conversation

@xnumad
Copy link
Copy Markdown
Contributor

@xnumad xnumad commented Jul 3, 2024

Contribution description

Avoid overflows when subtracting current time from point in time that is assumed to be in the future, which however sometimes is not the case. For the changed lines of this PR, such an overflow has been encountered. There may still be more cases.

Testing procedure

Have a 6LN in a state where it has a deprecated prefix (i.e. preferred lifetime = 0) in its prefix list.

  • Observe "nib prefix" printing an overflown value for the preferred lifetime, when it should print 0.
  • If the 6LN is a 6LR or 6LBR, it sends a Router Advertisement with a Prefix Information Option with an overflown value for the preferred lifetime, when it should be 0.

@github-actions github-actions bot added Area: network Area: Networking Area: sys Area: System labels Jul 3, 2024
Copy link
Copy Markdown
Contributor

@mguetschow mguetschow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the overflow check and handling looks sensible. I'm not an expert on gnrc though.

@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jul 4, 2024
@benpicco benpicco requested a review from fabian18 July 4, 2024 09:41
@riot-ci
Copy link
Copy Markdown

riot-ci commented Jul 4, 2024

Murdock results

✔️ PASSED

81a1e99 gnrc/ipv6: fix: Overflow in sent packet

Success Failures Total Runtime
10178 0 10178 17m:05s

Artifacts

@benpicco benpicco added this pull request to the merge queue Jul 4, 2024
Merged via the queue into RIOT-OS:master with commit b55efe2 Jul 4, 2024
@mguetschow mguetschow added this to the Release 2024.07 milestone Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: network Area: Networking Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants