WakeupController: remove --nflog-range
Trying to use the --nflog-range option for truncating packets received
with NFLOG does actually nothing and causes warnings to be printed by
IptablesRestoreController in netd.
The warning was added in https://patchwork.kernel.org/patch/9191269/
to iptables which also introduces a new XT_NFLOG_F_COPY_LEN
constant for passing down the packet copy len argument to the kernel
via a new --nflog-size option in iptables.
This patch removes the --nflog-range which is not necessary.
In reality WakeupController already specify a range argument when
subcribing to NFLOG using the NFLogListener interface in netd.
This sets the NFULNL_COPY_PACKET argument when doing the initial
Netlink request to NFLOG.
Bug: 73918721
Test: built, flashed, checked wakeup events are still correctly logged,
checked that warnings are not printed anymore.
Change-Id: I742aaecf8563d5e476805301e0435a412bb37e6a
diff --git a/server/WakeupController.cpp b/server/WakeupController.cpp
index 07ab87a..397e1a6 100644
--- a/server/WakeupController.cpp
+++ b/server/WakeupController.cpp
@@ -209,11 +209,10 @@
constexpr int kRateLimit = 10;
const char kFormat[] =
"*mangle\n%s %s -i %s -j NFLOG --nflog-prefix %s --nflog-group %d --nflog-threshold %d"
- " --nflog-range %d -m mark --mark 0x%08x/0x%08x -m limit --limit %d/s\nCOMMIT\n";
+ " -m mark --mark 0x%08x/0x%08x -m limit --limit %d/s\nCOMMIT\n";
const auto cmd = StringPrintf(
kFormat, action.c_str(), WakeupController::LOCAL_MANGLE_INPUT, ifName.c_str(),
- prefix.c_str(), NetlinkManager::NFLOG_WAKEUP_GROUP, kBatch,
- WakeupController::kDefaultPacketCopyRange, mark, mask, kRateLimit);
+ prefix.c_str(), NetlinkManager::NFLOG_WAKEUP_GROUP, kBatch, mark, mask, kRateLimit);
std::string out;
auto rv = mIptables->execute(V4V6, cmd, &out);