Open
Conversation
In short, any incoming authenticated packet and any outbound packet should affect the byte count.
Serock3
approved these changes
Feb 12, 2026
Contributor
Serock3
left a comment
There was a problem hiding this comment.
@Serock3 reviewed 2 files and all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @dlon).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The main difference I've seen compared to wireguard-go is that handshake initiations do not affect
tx_bytes.I've tried to make the behavior identical to that of wireguard-go. Any incoming packet that's accepted should contribute to
rx_bytes, and any outbound packet on the UDP socket should contribute totx_bytes. Except cookies. One difference is that wg-go addsMinMessageSizeto incoming packet lengths (https://github.com/WireGuard/wireguard-go/blob/f333402bd9cbe0f3eeb02507bd14e23d7d639280/device/receive.go#L463).Side-note: It might be more difficult than necessary to keep track of the side effects that different functions have on timers and counters.
This change is