summaryrefslogtreecommitdiff
path: root/accel-pppd/cli/std_cmd.c
AgeCommit message (Collapse)Author
2026-07-08triton: reject concurrent config reload requestsDenys Fedoryshchenko
triton_conf_reload() kept the notify callback in a single global slot, and the CLI reload command likewise stored its wakeup context in a global. A second reload issued while the first was still pending (from another CLI connection or SIGUSR1) overwrote both, so only the last requester was notified when the reload completed; the earlier CLI context slept forever in triton_context_schedule() and that connection hung while the rest of the daemon kept running. Make triton_conf_reload() return -1 when a reload is already pending, checked atomically under threads_lock, and pass a caller-provided arg through to the notify callback so each requester keeps its own state instead of sharing globals. The CLI reload's request struct is heap-allocated rather than kept on reload_exec's stack, since triton_context_schedule() can migrate a suspended context onto a different worker thread's stack before the notify callback runs, which would otherwise leave conf_reload_notify() writing through a stale stack pointer. Also mark the reload as running (need_config_reload = 2) before dropping threads_lock to call __config_reload(). Previously a worker woken during the reload (e.g. by the notify callback waking the CLI context, or any stray context wakeup) could loop through the idle path, decrement the active count back to zero and re-enter __config_reload() while need_config_reload was still set, running a second concurrent conf_reload() and invoking the notify callback twice - corrupting the wakeup list and, with the CLI's heap request, writing through freed memory. The SIGUSR1 handler used to call triton_conf_reload() directly from signal context, taking spinlocks and potentially running the whole config parse inside the handler. It now only sets a flag; the main thread waits with sigtimedwait() and performs the reload (and logs a warning when one is already in progress) from normal thread context. The CLI now replies "reload is already in progress" instead of losing the first requester's wakeup.
2026-05-04triton: encapsulate statistics countersDenys Fedoryshchenko
Group the Triton core statistics in struct triton_stat_t and keep the storage private to triton.c instead of exporting the writable triton_stat object through triton.h. This keeps ownership inside the Triton core while preserving the existing CLI and ACCEL-PPP-MIB counter semantics. Route counter updates through triton_stat_*() helpers. Thread, context, md handler, timer, mempool, CPU, and start-time update paths no longer open-code direct triton_stat mutations; the update policy now lives beside the Triton-owned storage and uses relaxed atomic operations for the simple counters. Make the CLI show-stat path render from a local snapshot and update statCore SNMP readers to use triton_stat_start_time() and triton_stat_cpu(). Out-of-tree modules that accessed the exported triton_stat object directly must switch to the new accessors, because triton_stat is no longer part of the public ABI. Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
2026-05-04session: encapsulate statistics countersDenys Fedoryshchenko
Group the core session starting, active, and finishing statistics behind the private ap_session_stat storage in session.c instead of exposing writable counters through ap_session.h. This keeps ownership inside the session core while preserving the existing CLI and ACCEL-PPP-MIB counter semantics. Route session counter updates through ap_session_stat_*() helpers. Session start, activation, termination, finish, and shutdown-idle paths no longer open-code individual counter increments/decrements; the update policy now lives beside the session-owned storage and uses relaxed atomic operations for the simple state counters. Make the CLI show-stat path render from a local snapshot and convert the PPP SNMP starting/active/finishing scalars from watched raw pointers to scalar handlers. PPP controllers now read max-session limits through ap_session_stat_starting() and ap_session_stat_active(), removing external direct access to ap_session_stat. Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
2025-11-23mempool: Fix 32-bit statsDenys Fedoryshchenko
We are living in 64-bit world long time, so there is very likely mempool stats might overflow past 4GB and report incorrect values. Updated mempool stats to use 64-bit counters so they don’t wrap past 4 GB and print correctly in CLI. Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
2024-09-02migrate from pcre to pcre2Sergey V. Lobanov
PCRE is not supported anymore and removed from several distros
2021-10-05Fixed typos in cli help.soup
2021-05-25cli: fix absent OK status for 'show version'Vladislav Grishenko
fix 4b52c1a3590b43ca892c460d9b1478e1da742156
2021-04-27Add 'show version' command in CLIroot
2021-02-06fix build with non-portable _SC_PAGE_SIZEVladislav Grishenko
2016-05-31accel-ppp Debian x32 fix minor -Wformat warningsMarek Michalkiewicz
Hello, small patch to avoid gcc -Wformat warnings on Debian x32 where time_t is "long long" (64-bit signed, to be 2038 safe), not "unsigned long" (32-bit unsigned) corresponding to "%lu" format strings. Regards, Marek
2016-03-18improved restart and termination procedureDmitry Kozlov
2016-03-18make termination caused by SIGTERM softDmitry Kozlov
2014-11-22remove trailing whitespacesDmitry Kozlov
2013-06-11fixed 'restart' commnd (stops all sessions, then do restart)Kozlov Dmitry
2013-05-23cli: fixed 'restart' command (do soft restart, i.e. terminate sessions by ↵Dmitry Kozlov
default)
2013-01-24merge upstreamKozlov Dmitry
2012-09-05Fix format string errorsGuillaume Nault
Fix several errors and compiler warnings in format string arguments. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
2012-07-11futher session backup implementationKozlov Dmitry
cli: introduced 'restart' command to restrat daemon
2012-06-19general preparation for IPoE integrationKozlov Dmitry
2011-08-23ppp: ipv6: multiple prefixes, route option, rdnss option implementationKozlov Dmitry
2011-08-19snmp supportKozlov Dmitry
2011-05-30rewrited initialization procedure (fix gcc-4.6 builds)Kozlov Dmitry
2011-02-13cli: terminate: check username is not NULLDmitry Kozlov
2011-01-27radius: extended statistics calculationDmitry Kozlov
2011-01-17memory usage optimizationDmitry Kozlov
2011-01-05rename accel-pptp to accel-pppDmitry Kozlov