Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Commit

Permalink
tokenbucket.c: prevent round-to-null operation if regen != 1
Browse files Browse the repository at this point in the history
  • Loading branch information
qmonnet committed Feb 7, 2017
1 parent 1948e10 commit facd869
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tokenbucket.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ struct bpf_elf_map __section("maps") xfsm_table = {
/* This is totally application dependent */
#define TB_TOKEN_NB 5ULL
#define TB_TOKEN_REGEN 1ULL
#define R (1/TB_TOKEN_REGEN)*1000000000 // ns^-1
#define R 1000000000/TB_TOKEN_REGEN // ns^-1
#define B (TB_TOKEN_NB-1)*R // ns

enum states {
Expand Down

0 comments on commit facd869

Please sign in to comment.