small problem with unlang (2.0.4)

Stefan Winter stefan.winter at restena.lu
Wed May 7 07:39:19 CEST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

|                 if ("%{proxy-reply:Framed-IP-Address}" =~
| /([0-9]+).([0-9]+).([0-9]+).([0-9]+)/){
|                         if (\
|                                 ( "%{expr: %{1} * 16777216 + %{2} *
| 65536 + %{3} * 256 + %{4}}" >= 3417153537  &&  \
|                                 "%{expr: %{1} * 16777216 + %{2} *
| 65536 + %{3} * 256 + %{4}}" <= 3417153790  ) \
|                         ) {
|                         update reply {
|                                 Reply-Message := "IP in range"
|                                 }
|                         }
|                         else {
|                                 update reply {
|                                         Reply-Message := "IP not in range"
|                                 }
|                                 attr_filter.strip-ip
|                         }
|
|
| During debugging I've noticed that the condition is always met, even
| though it shouldn't (ip in question 103.109.246.254)

Every condidtion should be in its own brace pair:

~                         if (\
~                                 (( "%{expr: %{1} * 16777216 + %{2} *
~ 65536 + %{3} * 256 + %{4}}" >= 3417153537)  &&  (\
~                                 "%{expr: %{1} * 16777216 + %{2} *
~ 65536 + %{3} * 256 + %{4}}" <= 3417153790  )) \
~                         ) {

Just a guess though, I'm not a pro in unlang myself (yet).

Stefan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFIIUCH+jm90f8eFWYRAquLAJ9Me8cySNvUAu4OmH3joThdagJdGgCdFFpA
238vUXkqpk1YDbPCob0Xa4w=
=RtWc
-----END PGP SIGNATURE-----



More information about the Freeradius-Users mailing list