diff --git a/policy/protocols/dns/auth-addl.bro b/policy/protocols/dns/auth-addl.bro index ab88eedb0a..ee42389a8e 100644 --- a/policy/protocols/dns/auth-addl.bro +++ b/policy/protocols/dns/auth-addl.bro @@ -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 # base script to be overridden since the base script will log immediately # after all of the ANS replies have been seen. - - if ( ! c?$dns ) - print c$id; - c$dns$ready=F; if ( ans$answer_type == DNS_AUTH ) diff --git a/src/Func.cc b/src/Func.cc index a6e31a0dd7..4a495904bd 100644 --- a/src/Func.cc +++ b/src/Func.cc @@ -236,7 +236,7 @@ TraversalCode Func::Traverse(TraversalCallback* cb) const } 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) { id = arg_id; @@ -246,7 +246,7 @@ BroFunc::BroFunc(ID* arg_id, Stmt* arg_body, id_list* aggr_inits, { Body b; b.stmts = AddInits(arg_body, aggr_inits); - b.priority = 0; + b.priority = priority; bodies.push_back(b); } } diff --git a/src/Func.h b/src/Func.h index 8ba954db37..6e1ea8597c 100644 --- a/src/Func.h +++ b/src/Func.h @@ -85,7 +85,7 @@ protected: class BroFunc : public Func { 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(); int IsPure() const; diff --git a/src/Var.cc b/src/Var.cc index 626f3f7e3c..390b6b3684 100644 --- a/src/Var.cc +++ b/src/Var.cc @@ -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 // we can later access the ID even if no implementations have been // defined. - Func* f = new BroFunc(id, 0, 0, 0); + Func* f = new BroFunc(id, 0, 0, 0, 0); id->SetVal(new Val(f)); id->SetConst(); } @@ -392,7 +392,7 @@ void end_func(Stmt* body, attr_list* attrs) id->ID_Val()->AsFunc()->AddBody(body, inits, frame_size, priority); 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->SetConst(); } diff --git a/testing/btest/Baseline/policy.protocols.dns.event-priority/dns.log b/testing/btest/Baseline/policy.protocols.dns.event-priority/dns.log new file mode 100644 index 0000000000..072f2e49df --- /dev/null +++ b/testing/btest/Baseline/policy.protocols.dns.event-priority/dns.log @@ -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 - -