summaryrefslogtreecommitdiff
path: root/staging/mops_tools.c
diff options
context:
space:
mode:
Diffstat (limited to 'staging/mops_tools.c')
0 files changed, 0 insertions, 0 deletions
cgit.cgi/linux/net-next.git/commit/?h=nds-private-remove&id=8e6ce7ebeb34f0992f56de078c3744fb383657fa'>8e6ce7ebeb34f0992f56de078c3744fb383657fa (diff)
net/sched/sch_htb: clamp xstats tokens to fit into 32-bit int
In kernel HTB keeps tokens in signed 64-bit in nanoseconds. In netlink protocol these values are converted into pshed ticks (64ns for now) and truncated to 32-bit. In struct tc_htb_xstats fields "tokens" and "ctokens" are declared as unsigned 32-bit but they could be negative thus tool 'tc' prints them as signed. Big values loose higher bits and/or become negative. This patch clamps tokens in xstat into range from INT_MIN to INT_MAX. In this way it's easier to understand what's going on here. Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat