commit | 936ad9582f19681b3d950479dafbd6091967dd39 | [log] [tgz] |
---|---|---|
author | Jordan Halterman <jordan@opennetworking.org> | Sat Dec 22 17:01:18 2018 -0800 |
committer | Charles Chan <charles@opennetworking.org> | Wed Jan 09 06:52:12 2019 +0000 |
tree | c9a7567774c82e40456299d5a355f8856b72c194 | |
parent | 1eaf106dbd8de20107848e6f511e20ef37149990 [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