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

Properly handle uint64 for HTB class rate/ceil #616

Merged
merged 1 commit into from
Mar 10, 2021

Conversation

imilchev
Copy link
Contributor

Currently, providing a rate or a ceil with a value higher than the uint32 max results in the value overflowing and a HTB class with wrong ceil/rate is created without any errors. The kernel already supports uint64 values so adding support for it to the library was relatively easy.

I also adjusted the test to use large values to verify that it works properly. With the old implementation, the same test would fail

@imilchev
Copy link
Contributor Author

imilchev commented Mar 8, 2021

@aboch @vishvananda could one of you have a look at this PR?

@@ -268,7 +268,8 @@ func TestHtbClassAddHtbClassChangeDel(t *testing.T) {
}

htbclassattrs := HtbClassAttrs{
Rate: 1234000,
Rate: uint64(1<<32) + 10,
Ceil: uint64(1<<32) + 20,
Copy link
Collaborator

Choose a reason for hiding this comment

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

:-)

@aboch
Copy link
Collaborator

aboch commented Mar 10, 2021

LGTM

@aboch aboch merged commit 2dd616d into vishvananda:master Mar 10, 2021
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.

None yet

2 participants