Swapping input and output octets

Anuruddha Premalal anuruddhapremalal at gmail.com
Wed Jul 13 06:43:18 CEST 2016

Hi All,

One of the NAS in our network is reporting the accounting the wrong way
(input and output octets are swapped).

I'm trying to fix it by adding a logic similar to below at the start of the
accounting section

if( request:NAS-IP-Address == "" && Acct-Status-Type != "Start"){
    Temp-Attribute = &Acct-Input-Octets
    update request {
        Acct-Input-Octets := &Temp-Attribute
        Acct-Output-Octets := &Acct-Input-Octets

I need to use a temporary variable to perform the data swapping.  However I
couldn't find a documentation of use of temporary variables or any such.
Is there a better way to achieve this. How can a variable be used to store
a value for a temporary reason without adding it to the request body.

*Anuruddha Premalala (MIEEE)Mobile : +94717213122E-mail  :
anuruddhapremalal at gmail.com <anuruddhapremalal at gmail.com>web      :
www.anuruddha.org <http://www.anuruddha.org>Sri Lanka.*

More information about the Freeradius-Users mailing list