summaryrefslogtreecommitdiff
path: root/server/RouteController.cpp
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2017-02-14 17:57:55 +0900
committerLorenzo Colitti <lorenzo@google.com>2017-02-14 18:28:59 +0900
commit220ca739ad863fcd40c9ca107f6e0f68f7a45d14 (patch)
tree0952fcd2e0e1ec060903bc72b60207c5387148db /server/RouteController.cpp
parentbbcd81d2e5103bbf465d69c6d0f958d3e740dd6e (diff)
Don't complain when deleting non-existent tethering rules.
clearTetheringRules ignores errors when deleting rules, because tethering rules don't exist unless tethering was enabled on the interface. sendNetlinkRequest shouldn't log an error in this case, since the caller is ignoring that error. Bug: 34873832 Test: bullhead builds, boots, spurious error messages gone Change-Id: Ib327e8a3aecd3a38d624baa8bf320da87e6c4f7c
Diffstat (limited to 'server/RouteController.cpp')
-rw-r--r--server/RouteController.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/server/RouteController.cpp b/server/RouteController.cpp
index 19907eb9..87b0043c 100644
--- a/server/RouteController.cpp
+++ b/server/RouteController.cpp
@@ -312,8 +312,12 @@ WARN_UNUSED_RESULT int modifyIpRule(uint16_t action, uint32_t priority, uint8_t
for (size_t i = 0; i < ARRAY_SIZE(AF_FAMILIES); ++i) {
rule.family = AF_FAMILIES[i];
if (int ret = sendNetlinkRequest(action, flags, iov, ARRAY_SIZE(iov))) {
- ALOGE("Error %s %s rule: %s", actionName(action), familyName(rule.family),
- strerror(-ret));
+ if (!(action == RTM_DELRULE && ret == -ENOENT && priority == RULE_PRIORITY_TETHERING)) {
+ // Don't log when deleting a tethering rule that's not there. This matches the
+ // behaviour of clearTetheringRules, which ignores ENOENT in this case.
+ ALOGE("Error %s %s rule: %s", actionName(action), familyName(rule.family),
+ strerror(-ret));
+ }
return ret;
}
}