Fix to support SADIS configs with multiple UniTagInformations
Change-Id: I2889e6e16efc19a7fa68b0c0cee332339cc0f1b8
diff --git a/app/src/main/java/org/opencord/dhcpl2relay/impl/DhcpL2Relay.java b/app/src/main/java/org/opencord/dhcpl2relay/impl/DhcpL2Relay.java
index c34d817..05774ab 100755
--- a/app/src/main/java/org/opencord/dhcpl2relay/impl/DhcpL2Relay.java
+++ b/app/src/main/java/org/opencord/dhcpl2relay/impl/DhcpL2Relay.java
@@ -952,13 +952,14 @@
}
UniTagInformation uniTagInformation = getUnitagInformationFromPacketContext(context, sub);
- if (uniTagInformation == null) {
- log.warn("Missing service information for connectPoint {} / cTag {}",
- context.inPacket().receivedFrom(), context.inPacket().parsed().getVlanID());
- return null;
+ if (uniTagInformation != null) {
+ return cp;
}
- return cp;
}
+ // no sadis config found for this connectPoint/vlan
+ log.warn("Missing service information for connectPoint {} / cTag {}",
+ context.inPacket().receivedFrom(), context.inPacket().parsed().getVlanID());
+
return null;
}
diff --git a/app/src/main/java/org/opencord/dhcpl2relay/impl/SimpleDhcpL2RelayCountersStore.java b/app/src/main/java/org/opencord/dhcpl2relay/impl/SimpleDhcpL2RelayCountersStore.java
index f95867c..4540cca 100644
--- a/app/src/main/java/org/opencord/dhcpl2relay/impl/SimpleDhcpL2RelayCountersStore.java
+++ b/app/src/main/java/org/opencord/dhcpl2relay/impl/SimpleDhcpL2RelayCountersStore.java
@@ -325,7 +325,7 @@
subscriberId = counterKey.counterClassKey;
}
- delegate.notify(new DhcpL2RelayEvent(DhcpL2RelayEvent.Type.STATS_UPDATE, null, null,
+ notifyDelegate(new DhcpL2RelayEvent(DhcpL2RelayEvent.Type.STATS_UPDATE, null, null,
new AbstractMap.SimpleEntry<>(counterKey.counterTypeKey.toString(),
new AtomicLong(counterValue)), subscriberId));
});