OSDN Git Service

Fix duplicate rule count modification.
authorSreeram Ramachandran <sreeram@google.com>
Tue, 10 Dec 2013 18:06:08 +0000 (10:06 -0800)
committerSreeram Ramachandran <sreeram@google.com>
Tue, 10 Dec 2013 18:06:08 +0000 (10:06 -0800)
ag/161626 introduced modifyRuleCount() to centralize rule count mutations, but
didn't remove the redundant block above the callsite in modifyRoute().

Change-Id: I5164ccf0d92041836166dcb5798be168276d3e7d

SecondaryTableController.cpp

index 42ed9cc..41e5bec 100644 (file)
@@ -177,14 +177,6 @@ int SecondaryTableController::modifyRoute(SocketClient *cli, const char *action,
         return -1;
     }
 
-    if (strcmp(action, ADD) == 0) {
-        mInterfaceRuleCount[tableIndex]++;
-    } else {
-        if (--mInterfaceRuleCount[tableIndex] < 1) {
-            mInterfaceRuleCount[tableIndex] = 0;
-            mInterfaceTable[tableIndex][0] = 0;
-        }
-    }
     modifyRuleCount(tableIndex, action);
     cli->sendMsg(ResponseCode::CommandOkay, "Route modified", false);
     return 0;