]> git.ozlabs.org Git - ppp.git/blobdiff - pppd/plugins/radius/radius.c
radius: interim and stop frames should not depend on successful start. (#299)
[ppp.git] / pppd / plugins / radius / radius.c
index 6ddd853db6784ae1ace9c6057830a70336b94208..44120e16d0ba120238c30ba9f5b4f11a9bd15b40 100644 (file)
@@ -112,7 +112,6 @@ static int radius_setmppekeys2(VALUE_PAIR *vp, REQUEST_INFO *req_info);
 #endif
 
 struct radius_state {
-    int accounting_started;
     int initialized;
     int client_port;
     int choose_ip;
@@ -961,12 +960,11 @@ radius_acct_start(void)
        /* RADIUS server could be down so make this a warning */
        syslog(LOG_WARNING,
                "Accounting START failed for %s", rstate.user);
-    } else {
-       rstate.accounting_started = 1;
-       /* Kick off periodic accounting reports */
-       if (rstate.acct_interim_interval) {
-           TIMEOUT(radius_acct_interim, NULL, rstate.acct_interim_interval);
-       }
+    }
+
+    /* Kick off periodic accounting reports */
+    if (rstate.acct_interim_interval) {
+       TIMEOUT(radius_acct_interim, NULL, rstate.acct_interim_interval);
     }
 }
 
@@ -992,14 +990,9 @@ radius_acct_stop(void)
        return;
     }
 
-    if (!rstate.accounting_started) {
-       return;
-    }
-
     if (rstate.acct_interim_interval)
        UNTIMEOUT(radius_acct_interim, NULL);
 
-    rstate.accounting_started = 0;
     rc_avpair_add(&send, PW_ACCT_SESSION_ID, rstate.session_id,
                   0, VENDOR_NONE);
 
@@ -1144,10 +1137,6 @@ radius_acct_interim(void *ignored)
        return;
     }
 
-    if (!rstate.accounting_started) {
-       return;
-    }
-
     rc_avpair_add(&send, PW_ACCT_SESSION_ID, rstate.session_id,
                   0, VENDOR_NONE);