chiark / gitweb /
core: serialize/deserialize IP accounting across daemon reload/reexec
authorLennart Poettering <lennart@poettering.net>
Thu, 7 Sep 2017 12:07:13 +0000 (14:07 +0200)
committerSven Eden <yamakuzure@gmx.net>
Thu, 7 Sep 2017 12:07:13 +0000 (14:07 +0200)
commitaa963ca5f68ea9cb593c62547e91443651865d5c
treee0d330bb51552d124c4a4fcf35cc10ca27a07400
parent0efbdf51d1a26201cd76c3d2c0377dcc088150b5
core: serialize/deserialize IP accounting across daemon reload/reexec

Make sure the current IP accounting counters aren't lost during
reload/reexec.

Note that we destroy all BPF file objects during a reload: the BPF
programs, the access and the accounting maps. The former two need to be
regenerated anyway with the newly loaded configuration data, but the
latter one needs to survive reloads/reexec. In this implementation I
opted to only save/restore the accounting map content instead of the map
itself. While this opens a (theoretic) window where IP traffic is still
accounted to the old map after we read it out, and we thus miss a few
bytes this has the benefit that we can alter the map layout between
versions should the need arise.
src/core/cgroup.c