- String router = hostRoute.getNexthop().toString();
- String dest = hostRoute.getDestination().toString();
+ if(hostRoute.getNexthop().getIpv4Address() == null ||
+ hostRoute.getDestination().getIpv4Prefix() == null ) {
+ // we only deal with IPv4 addresses
+ return;
+ }
+ String router = hostRoute.getNexthop().getIpv4Address().getValue();
+ String dest = hostRoute.getDestination().getIpv4Prefix().getValue();