Fixing bug with even priorities potentially being ignored for the

handler.
This commit is contained in:
Robin Sommer 2011-07-01 15:38:41 -07:00
parent 9709b1d522
commit bff8d39428
5 changed files with 7 additions and 9 deletions

View file

@ -16,10 +16,6 @@ event do_reply(c: connection, msg: dns_msg, ans: dns_answer, reply: string) &pri
# The "ready" flag will be set here. This causes the setting from the # The "ready" flag will be set here. This causes the setting from the
# base script to be overridden since the base script will log immediately # base script to be overridden since the base script will log immediately
# after all of the ANS replies have been seen. # after all of the ANS replies have been seen.
if ( ! c?$dns )
print c$id;
c$dns$ready=F; c$dns$ready=F;
if ( ans$answer_type == DNS_AUTH ) if ( ans$answer_type == DNS_AUTH )

View file

@ -236,7 +236,7 @@ TraversalCode Func::Traverse(TraversalCallback* cb) const
} }
BroFunc::BroFunc(ID* arg_id, Stmt* arg_body, id_list* aggr_inits, BroFunc::BroFunc(ID* arg_id, Stmt* arg_body, id_list* aggr_inits,
int arg_frame_size) int arg_frame_size, int priority)
: Func(BRO_FUNC) : Func(BRO_FUNC)
{ {
id = arg_id; id = arg_id;
@ -246,7 +246,7 @@ BroFunc::BroFunc(ID* arg_id, Stmt* arg_body, id_list* aggr_inits,
{ {
Body b; Body b;
b.stmts = AddInits(arg_body, aggr_inits); b.stmts = AddInits(arg_body, aggr_inits);
b.priority = 0; b.priority = priority;
bodies.push_back(b); bodies.push_back(b);
} }
} }

View file

@ -85,7 +85,7 @@ protected:
class BroFunc : public Func { class BroFunc : public Func {
public: public:
BroFunc(ID* id, Stmt* body, id_list* inits, int frame_size); BroFunc(ID* id, Stmt* body, id_list* inits, int frame_size, int priority);
~BroFunc(); ~BroFunc();
int IsPure() const; int IsPure() const;

View file

@ -178,7 +178,7 @@ static void make_var(ID* id, BroType* t, init_class c, Expr* init,
// For events, add a function value (without any body) here so that // For events, add a function value (without any body) here so that
// we can later access the ID even if no implementations have been // we can later access the ID even if no implementations have been
// defined. // defined.
Func* f = new BroFunc(id, 0, 0, 0); Func* f = new BroFunc(id, 0, 0, 0, 0);
id->SetVal(new Val(f)); id->SetVal(new Val(f));
id->SetConst(); id->SetConst();
} }
@ -392,7 +392,7 @@ void end_func(Stmt* body, attr_list* attrs)
id->ID_Val()->AsFunc()->AddBody(body, inits, frame_size, priority); id->ID_Val()->AsFunc()->AddBody(body, inits, frame_size, priority);
else else
{ {
Func* f = new BroFunc(id, body, inits, frame_size); Func* f = new BroFunc(id, body, inits, frame_size, priority);
id->SetVal(new Val(f)); id->SetVal(new Val(f));
id->SetConst(); id->SetConst();
} }

View file

@ -0,0 +1,2 @@
# ts uid id.orig_h id.orig_p id.resp_h id.resp_p proto trans_id query qclass qclass_name qtype qtype_name rcode rcode_name QR AA TC RD RA Z TTL answers auth addl
930613226.52907 UWkUyAuUGXf 212.180.42.100 25000 131.243.64.3 53 tcp 34798 - - - - - 0 NOERROR F F F F T 0 31337.0 4.3.2.1 - -