small problem with unlang (2.0.4)

Pshem Kowalczyk pshem.k at gmail.com
Wed May 7 09:04:15 CEST 2008


Thank you :-) brackets did the trick :-)

kind regards
Pshem


2008/5/7 Stefan Winter <stefan.winter at restena.lu>:
> -----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-----
>  -
>  List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
>



More information about the Freeradius-Users mailing list