On Jun 15, 2010 at 17:07, Andrei Pelinescu-Onciul andrei@iptel.org wrote:
On Jun 15, 2010 at 14:43, Klaus Darilion klaus.mailinglists@pernau.at wrote:
->
Am 15.06.2010 12:53, schrieb Andrei Pelinescu-Onciul:
On Jun 14, 2010 at 13:29, Steven C. Blairblairs@isc.upenn.edu wrote:
I'm migrating from an older version of SER to sip-router. A syntax check of my config file produces a few errors. The most confusing is :
0(27980) WARNING:<core> [cfg.y:3364]: warning in config file /home/blairs/ser-penn.cfg, line 1270, column 22-23: non constant rvalue in ip comparison
Line 1270 is the following if statement:
if (to_ip==$g.gw_ip&& !isflagset(FLAG_PSTN_ALLOWED) && !isflagset(FLAG_TOTAG) && method != "ACK"&& method != "CANCEL")
I do not see anything mentioned in config_migration.txt which explains this warning. Does anyone have any thoughts on how to correct this error?
You could safely ignore it. It was there just as a suggestion that comparing ips with non constant expressions ($g.gw_ip in this case) is not the fastest thing to do. I'll remove it.
Andrei, how will the comparison be done? IP-based or string-based.
If the value is not constant then string based. If it's constant then: ip based if possible/ip, if not try string based and if that fails too try comparing with DNS(target) and if this also fails try revDNS(to_ip) with string(target).
e.g. if the string 01.01.01.01 is compared against 1.1.1.1, will it be identical?
If 01.01.01.01 is the result of a non-constant expression, then no.
I was wrong, it will be identical, because of the DNS part. string comparison will fail, but then it will try to compare: ip(1.1.1.1) with DNS(01.01.01.01)=1.1.1.1.
Anyway I changed the code now and it won't attempt string comparisons anymore, it will try first to convert the other side to ip or a network/mask format. The only exception is for ~=, e.g. src_ip ~= "10.[12]..*" where regex matches will be used.
What about IPv6 addresses?
Same as above.
I guess I know now why I have left that warning :-)
Andrei