[Bro] using &*_expire with interval values defined before

Vern Paxson vern at icir.org
Mon Feb 7 19:00:35 PST 2005


> policy-script:
>  > const tcp_scan_period = 2 min &redef;
>  > global tcp_scan: table[addr] of count &write_expire=tcp_scan_period;
> 
> error:
>  > line xx (tcp_scan_period): bad tag in ExprVal::Val

Here's a patch to fix the bug.  (Also, a work-around would be to instead
stick "2 min" directly in rather than using a variable.)  This will be
included in the upcoming release.

		Vern


--- Val.cc.ORIG	2005/02/07 23:46:08	1.1
+++ Val.cc	2005/02/08 00:49:59
@@ -1490,7 +1490,7 @@
 
 	if ( a )
 		{
-		expire_time = a->AttrExpr()->ExprVal()->AsInterval();
+		expire_time = a->AttrExpr()->Eval(0)->AsInterval();
 
 		// As network_time is not necessarily initialized yet,
 		// we set a timer which fires immediately.



More information about the Bro mailing list