summaryrefslogtreecommitdiff
path: root/docs/ipoe_radius.md
diff options
context:
space:
mode:
authorDenys Fedoryshchenko <denys.f@collabora.com>2026-10-28 14:18:18 +0200
committerDenys Fedoryshchenko <denys.f@collabora.com>2026-10-28 14:35:29 +0200
commit58e399400c4ef4b71472ab7c2c71c54a677a05a8 (patch)
treee5405db640768f550e50420a1f13bef3404f5ac3 /docs/ipoe_radius.md
parentb8a3c54aa34434312aa0053686ec37a133fb54e6 (diff)
downloadaccel-ppp-58e399400c4ef4b71472ab7c2c71c54a677a05a8.tar.gz
accel-ppp-58e399400c4ef4b71472ab7c2c71c54a677a05a8.zip
log: bound log lines and share target unpacking
A log line is flushed only when its text ends in a newline, so it can be assembled from any number of log calls. Packet printers make one call per attribute, so a single line could grow far beyond LOG_MAX_SIZE, while the tcp, syslog and pgsql targets each copied the whole chunk list into a fixed size buffer without checking its length. Cap the accumulated line at LOG_MAX_SIZE in do_log(), keeping the trailing newline so the line is still flushed, and replace the three duplicated unpack loops with log_unpack_msg(), which never writes past the size it is given. The syslog bound is needed on its own: a session header plus a full length line does not fit its buffer. Also skip empty formatted strings, which made do_log() read the byte before its buffer. When a single call is cut short by vsnprintf its newline is lost; restore it when the format ends in one, so the line is closed instead of swallowing the next one. The syslog and pgsql targets now strip the trailing newline only when it is there, instead of dropping the last character of a line cut to fit. Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
Diffstat (limited to 'docs/ipoe_radius.md')
0 files changed, 0 insertions, 0 deletions