summaryrefslogtreecommitdiff
path: root/proto/perf/perf.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2019-07-24 15:38:32 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2019-07-24 15:38:32 +0200
commitcec40a74679821513e627f93b924067a404f6475 (patch)
tree793bbe5b326e7008e4657cf11b2937cafbe3d922 /proto/perf/perf.c
parent18f70a6229f586d5e4f387075be42d7a1ef5d269 (diff)
parent8263690e754a83b8f3c58bd0080a1628d6cba556 (diff)
Merge remote-tracking branch 'origin/mq-filter-stack'
Diffstat (limited to 'proto/perf/perf.c')
-rw-r--r--proto/perf/perf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/proto/perf/perf.c b/proto/perf/perf.c
index 8412254a..bfc0f09e 100644
--- a/proto/perf/perf.c
+++ b/proto/perf/perf.c
@@ -90,6 +90,8 @@ struct perf_random_routes {
struct rta a;
};
+static const uint perf_random_routes_size = sizeof(net_addr) + sizeof(rte *) + RTA_MAX_SIZE;
+
static inline s64 timediff(struct timespec *begin, struct timespec *end)
{ return (end->tv_sec - begin->tv_sec) * (s64) 1000000000 + end->tv_nsec - begin->tv_nsec; }
@@ -124,7 +126,7 @@ perf_loop(void *data)
struct perf_proto *p = data;
const uint N = 1U << p->exp;
- const uint offset = sizeof(net_addr) + RTA_MAX_SIZE;
+ const uint offset = perf_random_routes_size;
if (!p->run) {
ASSERT(p->data == NULL);