]> git.ipfire.org Git - thirdparty/systemd.git/commit
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)
committerLennart Poettering <lennart@poettering.net>
Fri, 22 Sep 2017 13:24:55 +0000 (15:24 +0200)
commit6b659ed87e98a69ab60ce2220f50a64af54a21d3
tree24c3d8d8f662782cbb72cfaddaafa99a2f2655bd
parenta79279c7fd9f43680da7d5cac382981cf7714f52
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
src/core/unit.c
src/core/unit.h