Commit df173bda authored by stephen hemminger's avatar stephen hemminger Committed by David S. Miller

netem: define NETEM_DIST_MAX

Rather than magic constant in code, expose the maximum size of
packet distribution table in API. In iproute2, q_netem defines
MAX_DIST as 16K already.
Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6373a9a2
...@@ -495,6 +495,7 @@ struct tc_netem_corrupt { ...@@ -495,6 +495,7 @@ struct tc_netem_corrupt {
}; };
#define NETEM_DIST_SCALE 8192 #define NETEM_DIST_SCALE 8192
#define NETEM_DIST_MAX 16384
/* DRR */ /* DRR */
......
...@@ -332,7 +332,7 @@ static int get_dist_table(struct Qdisc *sch, const struct nlattr *attr) ...@@ -332,7 +332,7 @@ static int get_dist_table(struct Qdisc *sch, const struct nlattr *attr)
int i; int i;
size_t s; size_t s;
if (n > 65536) if (n > NETEM_DIST_MAX)
return -EINVAL; return -EINVAL;
s = sizeof(struct disttable) + n * sizeof(s16); s = sizeof(struct disttable) + n * sizeof(s16);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment