diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2017-04-27 14:03:25 +0900 |
---|---|---|
committer | Lorenzo Colitti <lorenzo@google.com> | 2017-04-27 14:09:30 +0900 |
commit | 7647305c6b13d0e448b055c8af9c09b34af79f5c (patch) | |
tree | eb5d9df13b95a168dd0eea22436adda6405f28d4 | |
parent | 322e5f3db32a72de9453e14d26a7b7181b46d1ec (diff) | |
download | netd-7647305c6b13d0e448b055c8af9c09b34af79f5c.tar.gz |
Properly report failure in runIptablesAlertCmd.
Bug: 37641280
Test: netd_{unit,integration}_test pass
Change-Id: I36ef121ae0cfaa16032289fa6f8b0341e1a9ca20
-rw-r--r-- | server/BandwidthController.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/server/BandwidthController.cpp b/server/BandwidthController.cpp index 47fb8230..30a048aa 100644 --- a/server/BandwidthController.cpp +++ b/server/BandwidthController.cpp @@ -829,7 +829,6 @@ int BandwidthController::updateQuota(const char *quotaName, int64_t bytes) { } int BandwidthController::runIptablesAlertCmd(IptOp op, const char *alertName, int64_t bytes) { - int res = 0; const char *opFlag; std::string alertQuotaCmd = "*filter\n"; @@ -849,8 +848,7 @@ int BandwidthController::runIptablesAlertCmd(IptOp op, const char *alertName, in StringAppendF(&alertQuotaCmd, ALERT_IPT_TEMPLATE, opFlag, "bw_OUTPUT", bytes, alertName); StringAppendF(&alertQuotaCmd, "COMMIT\n"); - iptablesRestoreFunction(V4V6, alertQuotaCmd, nullptr); - return res; + return iptablesRestoreFunction(V4V6, alertQuotaCmd, nullptr); } int BandwidthController::runIptablesAlertFwdCmd(IptOp op, const char *alertName, int64_t bytes) { |