[VOL-5581]getchilddevice fix

Change-Id: I3e0f2f54f4a52dd466098b62044b907f24999d8d
Signed-off-by: Akash Reddy Kankanala <akash.kankanala@radisys.com>
diff --git a/VERSION b/VERSION
index f7e5aa8..214b521 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.7.12
+3.7.13
diff --git a/go.mod b/go.mod
index a30e8f9..b83ba2c 100644
--- a/go.mod
+++ b/go.mod
@@ -11,7 +11,7 @@
 	github.com/google/uuid v1.6.0
 	github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
 	github.com/opencord/voltha-lib-go/v7 v7.8.1
-	github.com/opencord/voltha-protos/v5 v5.7.1
+	github.com/opencord/voltha-protos/v5 v5.7.2
 	github.com/opentracing/opentracing-go v1.2.0
 	github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5
 	github.com/prometheus/client_golang v1.23.2
diff --git a/go.sum b/go.sum
index 74dff2c..253dc25 100644
--- a/go.sum
+++ b/go.sum
@@ -144,8 +144,8 @@
 github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs=
 github.com/opencord/voltha-lib-go/v7 v7.8.1 h1:tScnUJAtKo2bu6dg2NFirawIrXf2YwKjlb8+YdCDp2s=
 github.com/opencord/voltha-lib-go/v7 v7.8.1/go.mod h1:ege+7IIFRKe89exRbV6B9+N0J9pCJY8tCw1Ex/ryBQM=
-github.com/opencord/voltha-protos/v5 v5.7.1 h1:2K3s5nNn/EI6MJPgN1AK2db5RZCMisvK4SXqlOba5xA=
-github.com/opencord/voltha-protos/v5 v5.7.1/go.mod h1:KxcAB17mXTUSjA/rAziV3sDaOpntaFTCEXBJIfN5El4=
+github.com/opencord/voltha-protos/v5 v5.7.2 h1:7qWmJV8sz7UnJ5Y/kBbg9Zv502mdajqQOLNGVSume1o=
+github.com/opencord/voltha-protos/v5 v5.7.2/go.mod h1:KxcAB17mXTUSjA/rAziV3sDaOpntaFTCEXBJIfN5El4=
 github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o=
 github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
 github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
diff --git a/rw_core/core/device/manager_sbi.go b/rw_core/core/device/manager_sbi.go
index c229c4e..92762c1 100644
--- a/rw_core/core/device/manager_sbi.go
+++ b/rw_core/core/device/manager_sbi.go
@@ -129,7 +129,7 @@
 	if pDevice, err = dMgr.GetChildDevice(ctx, &ca.ChildDeviceFilter{
 		ParentId:     dd.ParentId,
 		SerialNumber: dd.SerialNumber,
-		OnuId:        dd.OnuId,
+		OnuId:        &dd.OnuId,
 		ParentPortNo: dd.ParentPortNo}); err == nil {
 		logger.Warnw(ctx, "child-device-exists", log.Fields{"parent-device-id": dd.ParentId, "serialNumber": dd.SerialNumber})
 		return pDevice, status.Errorf(codes.AlreadyExists, "%s", dd.SerialNumber)
@@ -191,9 +191,9 @@
 		if searchDevice, err := dMgr.getDeviceReadOnly(ctx, childDeviceID); err == nil {
 
 			foundOnuID := false
-			if searchDevice.ProxyAddress.OnuId == uint32(df.OnuId) {
+			if df.OnuId != nil && searchDevice.ProxyAddress.OnuId == uint32(df.GetOnuId()) {
 				if searchDevice.ParentPortNo == uint32(df.ParentPortNo) {
-					logger.Debugw(ctx, "found-child-by-onu-id", log.Fields{"parent-device-id": df.ParentId, "onuId": df.OnuId})
+					logger.Debugw(ctx, "found-child-by-onu-id", log.Fields{"parent-device-id": df.ParentId, "onuId": df.GetOnuId()})
 					foundOnuID = true
 				}
 			}
@@ -206,7 +206,7 @@
 
 			// if both onuId and serialNumber are provided both must be true for the device to be found
 			// otherwise whichever one found a match is good enough
-			if df.OnuId > 0 && df.SerialNumber != "" {
+			if df.OnuId != nil && df.SerialNumber != "" {
 				found = foundOnuID && foundSerialNumber
 			} else {
 				found = foundOnuID || foundSerialNumber
diff --git a/vendor/github.com/opencord/voltha-protos/v5/go/core_adapter/core_adapter.pb.go b/vendor/github.com/opencord/voltha-protos/v5/go/core_adapter/core_adapter.pb.go
index c79baf3..a184eb0 100644
--- a/vendor/github.com/opencord/voltha-protos/v5/go/core_adapter/core_adapter.pb.go
+++ b/vendor/github.com/opencord/voltha-protos/v5/go/core_adapter/core_adapter.pb.go
@@ -82,7 +82,7 @@
 	state         protoimpl.MessageState `protogen:"open.v1"`
 	ParentId      string                 `protobuf:"bytes,1,opt,name=parent_id,json=parentId,proto3" json:"parent_id,omitempty"`
 	SerialNumber  string                 `protobuf:"bytes,2,opt,name=serial_number,json=serialNumber,proto3" json:"serial_number,omitempty"`
-	OnuId         uint32                 `protobuf:"varint,3,opt,name=onu_id,json=onuId,proto3" json:"onu_id,omitempty"`
+	OnuId         *uint32                `protobuf:"varint,3,opt,name=onu_id,json=onuId,proto3,oneof" json:"onu_id,omitempty"`
 	ParentPortNo  uint32                 `protobuf:"varint,4,opt,name=parent_port_no,json=parentPortNo,proto3" json:"parent_port_no,omitempty"`
 	unknownFields protoimpl.UnknownFields
 	sizeCache     protoimpl.SizeCache
@@ -133,8 +133,8 @@
 }
 
 func (x *ChildDeviceFilter) GetOnuId() uint32 {
-	if x != nil {
-		return x.OnuId
+	if x != nil && x.OnuId != nil {
+		return *x.OnuId
 	}
 	return 0
 }
@@ -1181,12 +1181,13 @@
 	" voltha_protos/core_adapter.proto\x12\fcore_adapter\x1a\x1avoltha_protos/common.proto\x1a\x1avoltha_protos/voltha.proto\x1a\x1fvoltha_protos/openflow_13.proto\x1a\x1bvoltha_protos/adapter.proto\x1a\x1avoltha_protos/device.proto\x1a\x1evoltha_protos/extensions.proto\x1a\x1dvoltha_protos/omci_test.proto\"n\n" +
 	"\x13AdapterRegistration\x12*\n" +
 	"\aadapter\x18\x01 \x01(\v2\x10.adapter.AdapterR\aadapter\x12+\n" +
-	"\x06dTypes\x18\x02 \x01(\v2\x13.device.DeviceTypesR\x06dTypes\"\x92\x01\n" +
+	"\x06dTypes\x18\x02 \x01(\v2\x13.device.DeviceTypesR\x06dTypes\"\xa2\x01\n" +
 	"\x11ChildDeviceFilter\x12\x1b\n" +
 	"\tparent_id\x18\x01 \x01(\tR\bparentId\x12#\n" +
-	"\rserial_number\x18\x02 \x01(\tR\fserialNumber\x12\x15\n" +
-	"\x06onu_id\x18\x03 \x01(\rR\x05onuId\x12$\n" +
-	"\x0eparent_port_no\x18\x04 \x01(\rR\fparentPortNo\"q\n" +
+	"\rserial_number\x18\x02 \x01(\tR\fserialNumber\x12\x1a\n" +
+	"\x06onu_id\x18\x03 \x01(\rH\x00R\x05onuId\x88\x01\x01\x12$\n" +
+	"\x0eparent_port_no\x18\x04 \x01(\rR\fparentPortNoB\t\n" +
+	"\a_onu_id\"q\n" +
 	"\n" +
 	"PortFilter\x12\x1b\n" +
 	"\tdevice_id\x18\x01 \x01(\tR\bdeviceId\x12\x12\n" +
@@ -1364,6 +1365,7 @@
 	if File_voltha_protos_core_adapter_proto != nil {
 		return
 	}
+	file_voltha_protos_core_adapter_proto_msgTypes[1].OneofWrappers = []any{}
 	type x struct{}
 	out := protoimpl.TypeBuilder{
 		File: protoimpl.DescBuilder{
diff --git a/vendor/modules.txt b/vendor/modules.txt
index ea07767..64497b8 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -218,7 +218,7 @@
 github.com/opencord/voltha-lib-go/v7/pkg/mocks/kafka
 github.com/opencord/voltha-lib-go/v7/pkg/probe
 github.com/opencord/voltha-lib-go/v7/pkg/version
-# github.com/opencord/voltha-protos/v5 v5.7.1
+# github.com/opencord/voltha-protos/v5 v5.7.2
 ## explicit; go 1.25.3
 github.com/opencord/voltha-protos/v5/go/adapter_service
 github.com/opencord/voltha-protos/v5/go/common