Re: Unlang policy to remove duplicate attributes from reply?
Nick Porter <[email protected]>
| Newsgroups | gmane.comp.freeradius.user |
|---|---|
| Message-ID | <[email protected]> |
On 25/06/2025 10:22, tach yon wrote:
> if (number of Framed-IP-Address attributes > 1) {
You want to use the [#] suffix to get the number of instances of an
attribute - so
if (&reply:Framed-IP-Address[#] > 1) { ....
> update control {
> # Save the first Framed-IP-Address to a temporary String (because I read ipaddr type isn't available).
> &Tmp-String-0 := &reply:Framed-IP-Address[0]
Why use Tmp-String-0 - just use Tmp-IP-Address-0 to keep the data type
consistent - then there won't be any casting issues.
Of, since you're putting the result you want in the control list, you
can just use Framed-IP-Address- so
update control { &Framed-IP-Address := &reply:Framed-IP-Address[0] }
--
Nick Porter
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
OpenPGP_signature.asc
(application/pgp-signature, 665 B)
-----BEGIN PGP SIGNATURE----- wsD5BAABCAAjFiEEjw48vgR9BnUn1hS1ena+CY2NqIEFAmhbwaIFAwAAAAAACgkQena+CY2NqIE6 Dgv6Asnf32f2yLNcownDaz7CbKS34bWnvOCxeK9nBX5Aje7zWIFPG4TFLly88g/kjHlDGOguBZoK kkT/vxCwQmRPGesrg4o1fiUQxld21wt+hrWRBdo+iDi7I9kRactlp7c9BuYOwOikk3H5eV1/YCDc tyb6lW1oW7LF4u9jeXxE6uVcKoS9CFd8ljzixAx5bIc62I9KKB5Nta6qUodA7VMtHmWv8NFiYQuH JcTA72SVOfZYl4pHtuvltm+Q6CMp3nZS7YdvJfWufeRJmq9ltpszlfzaGqjRdtRX4yrHNhD0rPHc dvP6U0Q+NUtf4CEPkR/B0AmNRznFFaAGrdPjEbA4Q8QdypzZgQhfGp0ZXXA5uByrdX1zPtkrZ5nE VYmiF2UP546a4BItqZ7AX0eYVC+5ScyGBrf9B6W+bNN4szkA1UCju67ysYTCHc1WG0bLWPsHThfG xD7ThOv6Exsbw8KGkwIKEuRM/LPKEIL28IMV4rRTlPAmzpgF9kwzzvgERp7b =OJ/n -----END PGP SIGNATURE-----