You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(iroh-net): Also check the last packet in MagicSock::poll_recv (#2650)
## Description
<!-- A summary of what this pull request achieves and a rough list of
changes. -->
These are the quinn docs for `RecvMeta::stride`:
```rs
/// The size of a single datagram in the associated buffer
///
/// When GRO (Generic Receive Offload) is used this indicates the size of a single
/// datagram inside the buffer. If the buffer is larger, that is if [`len`] is greater
/// then this value, then the individual datagrams contained have their boundaries at
/// `stride` increments from the start. The last datagram could be smaller than
/// `stride`.
///
/// [`len`]: RecvMeta::len
```
So, `meta.len` isn't necessarily evenly divided by `meta.stride`, and
the last packet could be smaller than the stride.
The previous code assumed so, however. I think that's a bug. Not bad
enough that this caused issues, but still bad.
## Breaking Changes
None
<!-- Optional, if there are any breaking changes document them,
including how to migrate older code. -->
## Notes & open questions
What are the exact effects of this code having been incorrect before?
I guess one piece is that the metrics for computing the # received bytes
was way off.
Should we test this somehow specifically?
<!-- Any notes, remarks or open questions you have to make about the PR.
-->
## Change checklist
- [x] Self-review.
- ~~[ ] Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.~~
- ~~[ ] Tests if relevant.~~
- [x] All breaking changes documented.
---------
Co-authored-by: Floris Bruynooghe <[email protected]>
0 commit comments