radius.c: Include CLASS attribute in radius_acct_interim and radius_acct_stop
authorHauras Wigelstukas Alex <sysop@880.ru>
Fri, 17 Feb 2017 12:38:36 +0000 (19:38 +0700)
committerPaul Mackerras <paulus@ozlabs.org>
Sat, 23 Jun 2018 08:00:34 +0000 (18:00 +1000)
Some radius servers will not accept accounting packets without CLASS
attribute, so this includes it.

Signed-off-by: Hauras Wigelstukas Alex <sysop@880.ru>
pppd/plugins/radius/radius.c

index 4ba5f523ea0748af986aec1257ea9263e8fafe74..fbf872006005b59ca5472f73b1a5c1b69007bef4 100644 (file)
@@ -996,6 +996,10 @@ radius_acct_stop(void)
 
     rc_avpair_add(&send, PW_USER_NAME, rstate.user, 0, VENDOR_NONE);
 
+    if (rstate.class_len > 0)
+       rc_avpair_add(&send, PW_CLASS,
+                     rstate.class, rstate.class_len, VENDOR_NONE);
+
     av_type = PW_STATUS_STOP;
     rc_avpair_add(&send, PW_ACCT_STATUS_TYPE, &av_type, 0, VENDOR_NONE);
 
@@ -1140,6 +1144,10 @@ radius_acct_interim(void *ignored)
 
     rc_avpair_add(&send, PW_USER_NAME, rstate.user, 0, VENDOR_NONE);
 
+    if (rstate.class_len > 0)
+       rc_avpair_add(&send, PW_CLASS,
+                     rstate.class, rstate.class_len, VENDOR_NONE);
+
     av_type = PW_STATUS_ALIVE;
     rc_avpair_add(&send, PW_ACCT_STATUS_TYPE, &av_type, 0, VENDOR_NONE);