Removed duplicate warning log; simplified code
Change-Id: Ifff02ec5e1f1f01f4a8627964f59f8323abc4bc5
diff --git a/apps/dhcprelay/app/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerUtil.java b/apps/dhcprelay/app/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerUtil.java
index 5d07993..45e94c0 100644
--- a/apps/dhcprelay/app/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerUtil.java
+++ b/apps/dhcprelay/app/src/main/java/org/onosproject/dhcprelay/Dhcp6HandlerUtil.java
@@ -445,14 +445,6 @@
return false;
}
- private static boolean isRelayAgentIpFromCfgEmpty(DhcpServerInfo serverInfo, DeviceId receivedFromDevice) {
- if (!serverInfo.getRelayAgentIp6(receivedFromDevice).isPresent()) {
- log.warn("indirect connection: relayAgentIp NOT availale from config file! Use dynamic.");
- return true;
- }
- return false;
- }
-
private static Dhcp6Option getInterfaceIdIdOption(PacketContext context, Ethernet clientPacket) {
String inPortString = "-" + context.inPacket().receivedFrom().toString() + ":";
Dhcp6Option interfaceId = new Dhcp6Option();
@@ -567,7 +559,7 @@
etherReply.setVlanID(serverInfo.getDhcpConnectVlan().get().toShort());
ipv6Packet.setDestinationAddress(serverInfo.getDhcpServerIp6().get().toOctets());
}
- if (isRelayAgentIpFromCfgEmpty(serverInfo, receivedFromDevice)) {
+ if (!serverInfo.getRelayAgentIp6(receivedFromDevice).isPresent()) {
log.debug("indirect connection: relayAgentIp NOT availale from config file! Use dynamic. {}",
HexString.toHexString(relayAgentIp.toOctets(), ":"));
serverIpFacing = relayAgentIp;