Forum Discussion
hooleylist
Oct 22, 2009Cirrostratus
This is expected. From a past post:
http://devcentral.f5.com/Default.aspx?tabid=53&view=topic&postid=25222&ptarget=25227
Any variable declared in RULE_INIT is global. If you declare a variable using the global command or with two colons in front (set ::my_global_var 1), it will also be global. Global variables are accessible across all connections on any VIP. Local variables are accessible only on the current TCP connection pair (client - VIP and LTM - pool member).
If you reference a global variable in two different rules on the same or different VIPs, the variable is shared between the two connections and can be trampled. The second link below has details on one option for variable names.
Variable Scope & Lifetime
http://devcentral.f5.com/Default.aspx?tabid=53&forumid=5&tpage=1&view=topic&postid=18430
Multiple irules using same local variable name
http://devcentral.f5.com/Default.aspx?tabid=53&view=topic&postid=23503&ptarget=23582
Besides making global variable names fully qualified, can someone recommend any other ways to avoid such conflicts?
You'll need to come up with some scheme to ensure that your iRule's global variables are unique. Maybe you can come up with a naming convention within your company that does this. There isn't a simple technical solution for this.
Aaron