diff options
author | Maciej Żenczykowski <maze@google.com> | 2023-08-20 17:06:45 +0000 |
---|---|---|
committer | Maciej Żenczykowski <maze@google.com> | 2023-08-21 19:53:04 +0000 |
commit | 0602040bd43fc032246cb8b82825cf3229f83586 (patch) | |
tree | ddeb07eb1c0864d0251a4ff27d2946350caf0e32 | |
parent | 19f4c13cbea87741ec3df5285aa4bba3dd7f579d (diff) | |
download | net-0602040bd43fc032246cb8b82825cf3229f83586.tar.gz |
BpfMap.h - hide getMap()
This leaks (what should be) an internal only fd.
There's still multiple uses of getMap() left in:
common/native/bpf_headers/BpfMapTest.cpp
Test: TreeHugger
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I87a36f3f935ba9148ae4456fc6bf14b0e04f6038
-rw-r--r-- | common/native/bpf_headers/include/bpf/BpfMap.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/native/bpf_headers/include/bpf/BpfMap.h b/common/native/bpf_headers/include/bpf/BpfMap.h index aa7bafe8..0ab2fda1 100644 --- a/common/native/bpf_headers/include/bpf/BpfMap.h +++ b/common/native/bpf_headers/include/bpf/BpfMap.h @@ -180,9 +180,9 @@ class BpfMap { const function<Result<void>(const Key& key, const Value& value, BpfMap<Key, Value>& map)>& filter); +#ifdef BPF_MAP_MAKE_VISIBLE_FOR_TESTING const unique_fd& getMap() const { return mMapFd; }; -#ifdef BPF_MAP_MAKE_VISIBLE_FOR_TESTING // Copy assignment operator - due to need for fd duping, should not be used in non-test code. BpfMap<Key, Value>& operator=(const BpfMap<Key, Value>& other) { if (this != &other) mMapFd.reset(fcntl(other.mMapFd.get(), F_DUPFD_CLOEXEC, 0)); |