Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: track the keyID for UDP connections #97

Merged
merged 2 commits into from
Nov 6, 2020
Merged

Bugfix: track the keyID for UDP connections #97

merged 2 commits into from
Nov 6, 2020

Conversation

bemasc
Copy link

@bemasc bemasc commented Nov 5, 2020

This is important for applying usage limits to UDP streams. It also
fixes a bug in metrics reporting, because the shared metrics are not
tolerant of proxy<->target traffic that lacks a keyID.

This is important for applying usage limits to UDP streams.  It also
fixes a bug in metrics reporting, because the shared metrics are not
tolerant of proxy<->target traffic that lacks a keyID.
@bemasc bemasc requested a review from fortuna November 5, 2020 22:34
t.Errorf("Expected 2 reports, not %v", metrics.upstreamPackets)
}
for _, report := range metrics.upstreamPackets {
if report.clientProxyBytes == 0 {
Copy link

Choose a reason for hiding this comment

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

You may want to use testify to make the assertions more concise.

Copy link
Author

Choose a reason for hiding this comment

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

Done

service/udp.go Show resolved Hide resolved
@bemasc bemasc requested a review from fortuna November 5, 2020 23:02
if metrics.natEntriesAdded != 0 {
t.Error("Unexpected NAT entry on rejected packet")
metrics := sendToDiscard(payloads, onet.RequirePublicIP)
assert.Equal(t, 0, metrics.natEntriesAdded, "Unexpected NAT entry on rejected packet")
Copy link

Choose a reason for hiding this comment

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

FYI, assert doesn't stop the execution. For that you may want require.Equal().

Copy link
Author

Choose a reason for hiding this comment

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

I don't think we need to stop execution if this fails.

@fortuna
Copy link

fortuna commented Nov 6, 2020

Could you start a v1.3.3 release after you merge? I should include this on next weeks release.

@bemasc bemasc merged commit 4f3ce4d into master Nov 6, 2020
@bemasc bemasc deleted the bemasc-keyid branch November 6, 2020 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants