From bdb92e09f733726dcc400350c8f901e47ac5a491 Mon Sep 17 00:00:00 2001 From: Emil Mikulic Date: Thu, 1 Jan 2009 23:27:11 +1100 Subject: [PATCH] Don't apply ports-{max,keep} to protocols. This helps us survive proto accounting when --ports-max is zero. --- hosts_db.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hosts_db.c b/hosts_db.c index c66a075..9b8e15c 100644 --- a/hosts_db.c +++ b/hosts_db.c @@ -771,9 +771,10 @@ struct bucket * host_get_ip_proto(struct bucket *host, const uint8_t proto) { struct host *h = &host->u.host; + static const unsigned int PROTOS_MAX = 512, PROTOS_KEEP = 256; assert(h != NULL); if (h->ip_protos == NULL) - h->ip_protos = hashtable_make(PROTO_BITS, ports_max, ports_keep, + h->ip_protos = hashtable_make(PROTO_BITS, PROTOS_MAX, PROTOS_KEEP, hash_func_byte, free_func_simple, key_func_ip_proto, find_func_ip_proto, make_func_ip_proto, format_cols_ip_proto, format_row_ip_proto); -- 2.17.1