commit | 86e2a22c03600ec068e4d4789d1be243468be632 | [log] [tgz] |
---|---|---|
author | Sangho Shin <sangho@onlab.us> | Fri Oct 24 14:42:22 2014 -0700 |
committer | Sangho Shin <sangho@onlab.us> | Fri Oct 24 14:42:49 2014 -0700 |
tree | 57c49cd072bc5b105ff164112f93d3ced3bc7673 | |
parent | b5637088d847b39536859d006852840c0c639cb2 [diff] |
Added null check in inSameSubnet() Change-Id: Ib9b4498ac8d89eb86424b39979f39612f6860f4b
diff --git a/src/main/java/net/onrc/onos/apps/segmentrouting/IcmpHandler.java b/src/main/java/net/onrc/onos/apps/segmentrouting/IcmpHandler.java index e32d7c1..675a492 100644 --- a/src/main/java/net/onrc/onos/apps/segmentrouting/IcmpHandler.java +++ b/src/main/java/net/onrc/onos/apps/segmentrouting/IcmpHandler.java
@@ -446,6 +446,11 @@ String gwIpSrc = getGwIpForSubnet(ipv4.getSourceAddress()); String gwIpDest = getGwIpForSubnet(ipv4.getDestinationAddress()); + if (gwIpSrc == null || gwIpDest == null) { + log.warn("Failed to get gateway IP for {}", ipv4); + return false; + } + if (gwIpSrc.equals(gwIpDest)) { return true; }