X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=nexthopmgr%2Fnexthopmgr-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fvpnservice%2Fnexthopmgr%2FOdlInterfaceChangeListener.java;h=43a5fc509fea72e2628d3b2a7cabd65bde616216;hb=78638a6543c647ffff30d36e52604f5b7b5e785b;hp=e8a5bc2e1561fd58698a297990b7e99d40047a02;hpb=cd331f15ad231c081bf3725fd10e8cfd39f58241;p=vpnservice.git diff --git a/nexthopmgr/nexthopmgr-impl/src/main/java/org/opendaylight/vpnservice/nexthopmgr/OdlInterfaceChangeListener.java b/nexthopmgr/nexthopmgr-impl/src/main/java/org/opendaylight/vpnservice/nexthopmgr/OdlInterfaceChangeListener.java index e8a5bc2e..43a5fc50 100644 --- a/nexthopmgr/nexthopmgr-impl/src/main/java/org/opendaylight/vpnservice/nexthopmgr/OdlInterfaceChangeListener.java +++ b/nexthopmgr/nexthopmgr-impl/src/main/java/org/opendaylight/vpnservice/nexthopmgr/OdlInterfaceChangeListener.java @@ -8,6 +8,8 @@ package org.opendaylight.vpnservice.nexthopmgr; +import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress; + import org.opendaylight.controller.md.sal.binding.api.DataBroker; import org.opendaylight.controller.md.sal.binding.api.DataChangeListener; import org.opendaylight.yangtools.concepts.ListenerRegistration; @@ -69,14 +71,18 @@ public class OdlInterfaceChangeListener extends AbstractDataChangeListener identifier, Interface intrf) { - LOG.info("key: " + identifier + ", value=" + intrf ); + LOG.trace("Adding Interface : key: " + identifier + ", value=" + intrf ); if (intrf.getType().equals(L3tunnel.class)) { IfL3tunnel intfData = intrf.getAugmentation(IfL3tunnel.class); - String gwIp = intfData.getGatewayIp().toString(); - String remoteIp = intfData.getRemoteIp().toString(); + IpAddress gatewayIp = intfData.getGatewayIp(); + String gwIp = (gatewayIp == null) ? null : gatewayIp.toString(); + String remoteIp = null; if (gwIp != null) { remoteIp = gwIp; + } else { + IpAddress remIp = intfData.getRemoteIp(); + remoteIp = (remIp == null) ? null : remIp.toString(); } NodeConnectorId ofPort = intrf.getAugmentation(BaseIds.class).getOfPortId(); nexthopManager.createRemoteNextHop(intrf.getName(), ofPort.toString(), remoteIp); @@ -91,6 +97,7 @@ public class OdlInterfaceChangeListener extends AbstractDataChangeListener identifier, Interface intrf) { + LOG.trace("Removing interface : key: " + identifier + ", value=" + intrf ); if (intrf.getType().equals(L3tunnel.class)) { long dpnId = interfaceManager.getDpnForInterface(intrf.getName()); IfL3tunnel intfData = intrf.getAugmentation(IfL3tunnel.class);