commit | 9841077601580db1aefde1c8f926ef0226f57a81 | [log] [tgz] |
---|---|---|
author | Jordan Halterman <jordan@opennetworking.org> | Sat Dec 22 17:01:18 2018 -0800 |
committer | Charles Chan <rascov@gmail.com> | Tue Jan 08 18:35:09 2019 -0800 |
tree | dff44e049714b1faf0223d804488061cdd29f026 | |
parent | 71ad9d2081ee1965920b9f2d9578f332ccd91fd0 [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 63fef51..f052f04 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
@@ -134,7 +134,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