Commit a3dd3072 authored by Jan Včelák's avatar Jan Včelák 🚀 Committed by Daniel Salzman

mod-rrl: apply window size for new buckets

The RRL rate is measured and averaged over a period of time. This
measurement window was applied only for existing buckets. This change
enables this behavior for new buckets as well.

This should have no operational impact. But it will make our testing
a bit easier.
parent 70c062e4
......@@ -385,7 +385,8 @@ rrl_item_t *rrl_hash(rrl_table_t *t, const struct sockaddr_storage *a, rrl_req_t
/* Find an exact match in <id, id + HOP_LEN). */
uint16_t *qname = (uint16_t *)(buf + sizeof(uint8_t) + sizeof(uint64_t));
rrl_item_t match = {
0, *((uint64_t *)(buf + 1)), t->rate, /* hop, netblk, ntok */
0, *((uint64_t *)(buf + 1)), /* hop, netblk */
t->rate * RRL_CAPACITY, /* ntok */
buf[0], RRL_BF_NULL, /* cls, flags */
hash((char *)(qname + 1), *qname), stamp /* qname, time */
};
......
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