commit | fd82236f8e3c52e8c7519ba1687fdc2c00be51ab | [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:23 2019 +0000 |
tree | 6e18411113dbda44b485ec5ef9be1fc076d47236 | |
parent | 594843aa6db6786d86ce776098d8359cb73d2389 [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