Skip to content
Snippets Groups Projects

RRL: asynchronous tests

Closed Jan Včelák requested to merge rrl-async-tests into master
2 files
+ 111
41
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 2
2
@@ -33,7 +33,6 @@
#define RRL_V4_PREFIX ((uint32_t)0x00ffffff) /* /24 */
#define RRL_V6_PREFIX ((uint64_t)0x00ffffffffffffff) /* /56 */
/* Defaults */
#define RRL_DEFAULT_RATE 100
#define RRL_CAPACITY 4 /* N seconds. */
#define RRL_SSTART 2 /* 1/Nth of the rate for slow start */
#define RRL_PSIZE_LARGE 1024
@@ -391,7 +390,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 */
};
Loading