]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virnetdevbandwidth: Don't generate burst outside of boundaries
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 5 Mar 2021 09:13:36 +0000 (10:13 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 9 Mar 2021 08:56:48 +0000 (09:56 +0100)
commit01e206c3e353dd406a1a14193358fa617027e105
treedcff585484e7931bb99c23354741d25cca98c0d4
parent6564cb01e10094914aca6ea0c562e3769e76e4b8
virnetdevbandwidth: Don't generate burst outside of boundaries

When generating TC rules for domain's outbound traffic, Libvirt
will use the 'average' as the default for 'burst' - it's been
this way since the feature introduction in v0.9.4-rc1~22. The
reason is that 'average' considers 'burst' for policing. However,
when parsing its command line TC uses an unsigned int (with
overflow detection) to store the 'burst' size. This means, that
the upper limit for the value is UINT_MAX, well UINT_MAX / 1024
because we are putting the value in KiB onto the command line.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1912210
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
src/util/virnetdevbandwidth.c
tests/virnetdevbandwidthtest.c