commit | 8c95b1e5f571e0b32e3785834964cc1b476b72f1 | [log] [tgz] |
---|---|---|
author | Jordan Halterman <jordan@opennetworking.org> | Sat Dec 22 17:01:18 2018 -0800 |
committer | Ray Milkey <ray@opennetworking.org> | Fri Jan 11 04:45:08 2019 +0000 |
tree | 2094b6c22841cc2a3d9a0c8a5941e956dd906ae9 | |
parent | 4fff3e89c550d1e53a59479d4e38491aed686c89 [diff] |
Lookup stored route on remove to ensure bytes consistency. Change-Id: If0e255f9f2a2873fe9e18eb7876af9afa118605e
diff --git a/apps/route-service/app/src/main/java/org/onosproject/routeservice/store/DefaultRouteTable.java b/apps/route-service/app/src/main/java/org/onosproject/routeservice/store/DefaultRouteTable.java index b52618c..ffbf2ba 100644 --- a/apps/route-service/app/src/main/java/org/onosproject/routeservice/store/DefaultRouteTable.java +++ b/apps/route-service/app/src/main/java/org/onosproject/routeservice/store/DefaultRouteTable.java
@@ -132,7 +132,14 @@ @Override public void remove(Route route) { - routes.remove(route.prefix().toString(), new RawRoute(route)); + getRoutes(route.prefix()) + .routes() + .stream() + .filter(r -> r.equals(route)) + .findAny() + .ifPresent(matchRoute -> { + routes.remove(matchRoute.prefix().toString(), new RawRoute(matchRoute)); + }); } @Override