Don't apply ports-{max,keep} to protocols.
authorEmil Mikulic <emikulic@gmail.com>
Thu, 1 Jan 2009 12:27:11 +0000 (23:27 +1100)
committerEmil Mikulic <emikulic@gmail.com>
Fri, 24 Apr 2009 11:40:23 +0000 (21:40 +1000)
This helps us survive proto accounting when --ports-max is zero.

hosts_db.c

index c66a075..9b8e15c 100644 (file)
@@ -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);