diff options
author | Jaco Kroon <jaco@uls.co.za> | 2021-07-30 05:24:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-30 13:24:08 +1000 |
commit | 7fc276dee025815eb8d116f52d9193808b164bbd (patch) | |
tree | cdc1998126b2ec84edcb1fda62d40aae9529dd2c | |
parent | 49e1aff19a7ba4376b2a8387f11ff92382cef34f (diff) | |
download | ppp-7fc276dee025815eb8d116f52d9193808b164bbd.tar.gz |
radius: interim and stop frames should not depend on successful start. (#299)
It could simply be that the accounting server is temporarily down, and
any good accounting server should be able to recover from missed
start/stop frames. In particular Acct-Session-Time on the first seen
interim update or even stop frame allows for determining start time.
Signed-off-by: Jaco Kroon <jaco@uls.co.za>
Co-authored-by: Jaco Kroon <jaco@iewc.co.za>
-rw-r--r-- | pppd/plugins/radius/radius.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/pppd/plugins/radius/radius.c b/pppd/plugins/radius/radius.c index 6ddd853..44120e1 100644 --- a/pppd/plugins/radius/radius.c +++ b/pppd/plugins/radius/radius.c @@ -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); |