[Bro-Dev] #636: topic/jsiwek/comphash-func-determinism
Bro Tracker
bro at tracker.bro-ids.org
Thu Oct 6 08:04:03 PDT 2011
#636: topic/jsiwek/comphash-func-determinism
----------------------------+------------------------
Reporter: jsiwek | Owner: jsiwek
Type: Merge Request | Status: assigned
Priority: Normal | Milestone:
Component: Bro | Version: git/master
Resolution: | Keywords:
----------------------------+------------------------
Comment (by jsiwek):
> - I don't like assigning the unique names to anonymous functions, with
them then printing like
>
> {{{anonymous-function3 { return ((Notice::n$note in
Notice::alarmed_types)); }}}}
>
> - More generally,assigning dummy names seems like overkill to me just to
achieve consistent output for testing.
The other goal was to achieve consistent ordering during the application
of notice policy items in normal operation. I think when I was looking
for alternatives, not using the same priority in multiple `PolicyItem`s
would meet that goal, but I'm not sure if the underlying issue would crop
up again someplace else in the future.
> Doesn't the earlier suggestion work to hash the functions Describe()
output when in seeded-hash mode?
Per the goal above I thought we said it has to work even outside of
seeded-mode?
As for hashing the function's `Describe()` output, how would the recovery
process work for that? If you wanted the original func Val that was
hashed, that would still involve some sort of lookup against a global
mapping of function bodies, otherwise we'd need to create a new func Val
from the function body? It seemed easiest to lookup by a unique name.
> - Is the is_singelton case correct in the following?
I think so -- it should be almost equivalent to how strings are done.
> I don't see the distinction made when the hash is created?
I thought the distinction came from `ComputeHash()` branching to either
`ComputeSingletonHash()` or `SingleValHash()` depending on `is_singleton`.
--
Ticket URL: <http://tracker.bro-ids.org/bro/ticket/636#comment:2>
Bro Tracker <http://tracker.bro-ids.org/bro>
Bro Issue Tracker
More information about the bro-dev
mailing list