Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
6e1670f
feat: upgrade openapi to R17
pf-lin Aug 12, 2024
e9e0de4
feat: upgrade routes
pf-lin Aug 12, 2024
548c018
fix: error strings should not be capitalized
pf-lin Aug 12, 2024
00fb408
fix: fix HandlePDUSessionSMContextCreate
ianchen0119 Aug 14, 2024
775bc44
chore: change variable name
pf-lin Sep 5, 2024
838ebc5
chore: use problem details within openapi to represent
pf-lin Sep 8, 2024
618f78b
chore: update go.mod
pf-lin Sep 8, 2024
ed63477
chore: modify go.mod
pf-lin Sep 16, 2024
fb6ecbf
chore: check if response is nil
pf-lin Sep 16, 2024
23685c7
chore: modify the type of notification
pf-lin Sep 18, 2024
40eac4b
fix: refactor error handling in service functions
pf-lin Sep 24, 2024
f4ea19b
Merge branch 'main' into feat/r17
pf-lin Sep 24, 2024
d1c5442
fix: refactor error handling in terminateProcedure function
pf-lin Sep 30, 2024
dcc6060
fix: unable to terminate when registration with NRF is unsuccessful
pf-lin Oct 22, 2024
37def93
fix: update openapi hash
andy89923 Oct 25, 2024
1aabc58
fix: Test error on TestHandlePDUSessionSMContextCreate
andy89923 Oct 25, 2024
80cb4f9
Merge branch 'main' into feat/r17
pf-lin Nov 6, 2024
0e68e7d
refactor: update subscription methods to use R17's openapi client and…
pf-lin Nov 7, 2024
167482d
chore: update go.mod
pf-lin Nov 7, 2024
7145015
fix: handle location when http status is 201
pf-lin Nov 20, 2024
aee7e62
fix: log successful deregistration from NRF only once
pf-lin Nov 25, 2024
bd84e52
fix: delete UPF.UPIPInfo field
yoursunny Dec 13, 2024
2e95f0e
feat: Add session level charging URRs to ULCL created path
lyz508 Dec 23, 2024
64c2faf
Merge pull request #117 from pf-lin/feat/r17
ianchen0119 Dec 25, 2024
d9fed24
chore: update net module to v0.33.0
Alonza0314 Dec 30, 2024
71c8b6b
chore: update openapi
ianchen0119 Jan 3, 2025
f0ebd50
fix: qos id identical in pdu session establishment accept message error
ming-hsien Nov 27, 2024
6baf74d
feat: add defruleid for smcontext and allocate id when construct new …
ming-hsien Nov 27, 2024
e3227d8
fix: golangci lint error
ming-hsien Nov 27, 2024
145159f
chore: tidy module
Alonza0314 Jan 7, 2025
a1d09e2
fix: wrong uri format in location header
Alonza0314 Jan 15, 2025
53a1237
fix: make N2 PDUSession release cmd sent under activate state
Alonza0314 Jan 7, 2025
74615fa
fix: remove uncessary qos data record form pcc ruls
Alonza0314 Jan 21, 2025
07f9b3c
feat: add length check on uuid
Alonza0314 Feb 25, 2025
807f90c
Merge pull request #144 from Alonza0314/fix/api-smcontext-reply-hdr-l…
ianchen0119 Feb 25, 2025
ae929a0
fix: fix online charging problem in ULCL
lyz508 Jan 14, 2025
38b371e
fix: linter error
lyz508 Jan 14, 2025
2e5fb4b
refactor: return and check err for EstablishULCL()
ianchen0119 Feb 23, 2025
964b832
fix: failed to add default PCC rules to smContext
lyz508 Feb 25, 2025
b2f5680
chore: add note about redundent URR problem
lyz508 Feb 25, 2025
ddfb1e6
fix: linter error
lyz508 Feb 25, 2025
e7ea3f5
fix: ULCL not working; close #141
louisroyer Feb 4, 2025
724b44e
Merge pull request #147 from louisroyer/issue141
ianchen0119 Feb 28, 2025
76da76a
feat: Add session level charging URRs to ULCL created path
lyz508 Dec 23, 2024
f91f9d2
feat: upgrade openapi to R17
pf-lin Aug 12, 2024
585c775
feat: upgrade routes
pf-lin Aug 12, 2024
5a6bc00
fix: error strings should not be capitalized
pf-lin Aug 12, 2024
84348e1
fix: fix HandlePDUSessionSMContextCreate
ianchen0119 Aug 14, 2024
026ef45
chore: change variable name
pf-lin Sep 5, 2024
80bf20e
chore: use problem details within openapi to represent
pf-lin Sep 8, 2024
2d793b8
chore: update go.mod
pf-lin Sep 8, 2024
b465abb
chore: modify go.mod
pf-lin Sep 16, 2024
9fa4607
chore: check if response is nil
pf-lin Sep 16, 2024
f8e050e
chore: modify the type of notification
pf-lin Sep 18, 2024
fa92098
fix: refactor error handling in service functions
pf-lin Sep 24, 2024
c6a50b0
fix: refactor error handling in terminateProcedure function
pf-lin Sep 30, 2024
bd1d244
fix: unable to terminate when registration with NRF is unsuccessful
pf-lin Oct 22, 2024
3261cef
fix: update openapi hash
andy89923 Oct 25, 2024
a4277bc
fix: Test error on TestHandlePDUSessionSMContextCreate
andy89923 Oct 25, 2024
bb625a0
refactor: update subscription methods to use R17's openapi client and…
pf-lin Nov 7, 2024
7483d9f
chore: update go.mod
pf-lin Nov 7, 2024
6332d05
fix: handle location when http status is 201
pf-lin Nov 20, 2024
1f7ec7a
fix: log successful deregistration from NRF only once
pf-lin Nov 25, 2024
8046287
chore: update net module to v0.33.0
Alonza0314 Dec 30, 2024
cd93fbf
chore: update openapi
ianchen0119 Jan 3, 2025
7c35ec1
chore: tidy module
Alonza0314 Jan 7, 2025
7f14dda
fix: wrong uri format in location header
Alonza0314 Jan 15, 2025
53d82d4
feat: add length check on uuid
Alonza0314 Feb 25, 2025
5ec555f
fix: ULCL not working; close #141
louisroyer Feb 4, 2025
d2834ab
Merge remote-tracking branch 'origin/next' into next
ianchen0119 Mar 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,23 @@ module github.com/free5gc/smf
go 1.21

require (
github.com/antihax/optional v1.0.0
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d
github.com/davecgh/go-spew v1.1.1
github.com/free5gc/aper v1.0.5
github.com/free5gc/nas v1.1.3
github.com/free5gc/nas v1.1.4-0.20240801045646-998afcbf3811
github.com/free5gc/ngap v1.0.8
github.com/free5gc/openapi v1.0.8
github.com/free5gc/pfcp v1.0.8-0.20241205172610-db6cd2e7f0bf
github.com/free5gc/openapi v1.0.9-0.20250102055216-bb5814d1e736
github.com/free5gc/pfcp v1.0.7
github.com/free5gc/util v1.0.6
github.com/gin-gonic/gin v1.9.1
github.com/google/uuid v1.3.0
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
github.com/h2non/gock v1.2.0
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.8.1
github.com/sirupsen/logrus v1.9.3
github.com/smartystreets/goconvey v1.6.4
github.com/stretchr/testify v1.8.3
github.com/stretchr/testify v1.9.0
github.com/urfave/cli v1.22.5
go.uber.org/mock v0.4.0
gopkg.in/h2non/gock.v1 v1.1.2
gopkg.in/yaml.v2 v2.4.0
)

Expand All @@ -30,16 +28,17 @@ require (
github.com/bytedance/sonic v1.9.1 // indirect
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d // indirect
github.com/free5gc/tlv v1.0.3-0.20241204153300-1005a019612d // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/free5gc/tlv v1.0.2 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gin-contrib/sse v0.1.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-playground/locales v0.14.1 // indirect
github.com/go-playground/universal-translator v0.18.1 // indirect
github.com/go-playground/validator/v10 v10.14.0 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/golang-jwt/jwt v3.2.1+incompatible // indirect
github.com/golang/protobuf v1.5.0 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 // indirect
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 // indirect
github.com/json-iterator/go v1.1.12 // indirect
Expand All @@ -48,7 +47,7 @@ require (
github.com/kr/pretty v0.3.1 // indirect
github.com/leodido/go-urn v1.2.4 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mitchellh/mapstructure v1.4.2 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
Expand All @@ -60,13 +59,17 @@ require (
github.com/tim-ywliu/nested-logrus-formatter v1.3.2 // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/ugorji/go/codec v1.2.11 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/httptrace/otelhttptrace v0.49.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
golang.org/x/arch v0.3.0 // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/oauth2 v0.0.0-20210810183815-faf39c7919d5 // indirect
golang.org/x/oauth2 v0.21.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
410 changes: 38 additions & 372 deletions go.sum

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions internal/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type SMFContext struct {
ExternalAddr string
ListenAddr string

UDMProfile models.NfProfile
UDMProfile models.NrfNfDiscoveryNfProfile
NfProfile NFProfile

Key string
Expand Down Expand Up @@ -302,13 +302,13 @@ func GetUEDefaultPathPool(groupName string) *UEDefaultPaths {
return smfContext.UEDefaultPathPool[groupName]
}

func (c *SMFContext) GetTokenCtx(serviceName models.ServiceName, targetNF models.NfType) (
func (c *SMFContext) GetTokenCtx(serviceName models.ServiceName, targetNF models.NrfNfManagementNfType) (
context.Context, *models.ProblemDetails, error,
) {
if !c.OAuth2Required {
return context.TODO(), nil, nil
}
return oauth.GetTokenCtx(models.NfType_SMF, targetNF,
return oauth.GetTokenCtx(models.NrfNfManagementNfType_SMF, targetNF,
c.NfInstanceID, c.NrfUri, string(serviceName))
}

Expand Down
16 changes: 8 additions & 8 deletions internal/context/nf_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

type NFProfile struct {
NFServices *[]models.NfService
NFServices *[]models.NrfNfManagementNfService
NFServiceVersion *[]models.NfServiceVersion
SMFInfo *models.SmfInfo
PLMNList *[]models.PlmnId
Expand All @@ -30,12 +30,12 @@ func (c *SMFContext) SetupNFProfile(nfProfileconfig *factory.Config) {
}

// set NFServices
c.NfProfile.NFServices = new([]models.NfService)
c.NfProfile.NFServices = new([]models.NrfNfManagementNfService)
for _, serviceName := range nfProfileconfig.Configuration.ServiceNameList {
*c.NfProfile.NFServices = append(*c.NfProfile.NFServices, models.NfService{
*c.NfProfile.NFServices = append(*c.NfProfile.NFServices, models.NrfNfManagementNfService{
ServiceInstanceId: GetSelf().NfInstanceID + serviceName,
ServiceName: models.ServiceName(serviceName),
Versions: c.NfProfile.NFServiceVersion,
Versions: *c.NfProfile.NFServiceVersion,
Scheme: models.UriScheme_HTTPS,
NfServiceStatus: models.NfServiceStatus_REGISTERED,
ApiPrefix: fmt.Sprintf("%s://%s:%d", GetSelf().URIScheme, GetSelf().RegisterIPv4, GetSelf().SBIPort),
Expand All @@ -59,11 +59,11 @@ func (c *SMFContext) SetupNFProfile(nfProfileconfig *factory.Config) {
}
}

func SNssaiSmfInfo() *[]models.SnssaiSmfInfoItem {
func SNssaiSmfInfo() []models.SnssaiSmfInfoItem {
snssaiInfo := make([]models.SnssaiSmfInfoItem, 0)
for _, snssai := range smfContext.SnssaiInfos {
var snssaiInfoModel models.SnssaiSmfInfoItem
snssaiInfoModel.SNssai = &models.Snssai{
snssaiInfoModel.SNssai = &models.ExtSnssai{
Sst: snssai.Snssai.Sst,
Sd: snssai.Snssai.Sd,
}
Expand All @@ -75,10 +75,10 @@ func SNssaiSmfInfo() *[]models.SnssaiSmfInfoItem {
})
}

snssaiInfoModel.DnnSmfInfoList = &dnnModelList
snssaiInfoModel.DnnSmfInfoList = dnnModelList

snssaiInfo = append(snssaiInfo, snssaiInfoModel)
}

return &snssaiInfo
return snssaiInfo
}
6 changes: 3 additions & 3 deletions internal/context/pcc_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,11 @@ func createNasPacketFilter(
smCtx.PacketFilterIDToNASPFID[pfInfo.PackFiltId] = uint8(pfId)

switch pfInfo.FlowDirection {
case models.FlowDirectionRm_DOWNLINK:
case models.FlowDirection_DOWNLINK:
pf.Direction = nasType.PacketFilterDirectionDownlink
case models.FlowDirectionRm_UPLINK:
case models.FlowDirection_UPLINK:
pf.Direction = nasType.PacketFilterDirectionUplink
case models.FlowDirectionRm_BIDIRECTIONAL:
case models.FlowDirection_BIDIRECTIONAL:
pf.Direction = nasType.PacketFilterDirectionBidirectional
}

Expand Down
16 changes: 8 additions & 8 deletions internal/context/pfcp_reports.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func (smContext *SMContext) HandleReports(
usageReportRequest []*pfcp.UsageReportPFCPSessionReportRequest,
usageReportModification []*pfcp.UsageReportPFCPSessionModificationResponse,
usageReportDeletion []*pfcp.UsageReportPFCPSessionDeletionResponse,
nodeId pfcpType.NodeID, reportTpye models.TriggerType,
nodeId pfcpType.NodeID, reportTpye models.ChfConvergedChargingTriggerType,
) {
var usageReport UsageReport
upf := RetrieveUPFNodeByNodeID(nodeId)
Expand Down Expand Up @@ -70,23 +70,23 @@ func (smContext *SMContext) HandleReports(
}
}

func identityTriggerType(usarTrigger *pfcpType.UsageReportTrigger) models.TriggerType {
var trigger models.TriggerType
func identityTriggerType(usarTrigger *pfcpType.UsageReportTrigger) models.ChfConvergedChargingTriggerType {
var trigger models.ChfConvergedChargingTriggerType

switch {
case usarTrigger.Volth:
trigger = models.TriggerType_QUOTA_THRESHOLD
trigger = models.ChfConvergedChargingTriggerType_QUOTA_THRESHOLD
case usarTrigger.Volqu:
trigger = models.TriggerType_QUOTA_EXHAUSTED
trigger = models.ChfConvergedChargingTriggerType_QUOTA_EXHAUSTED
case usarTrigger.Quvti:
trigger = models.TriggerType_VALIDITY_TIME
trigger = models.ChfConvergedChargingTriggerType_VALIDITY_TIME
case usarTrigger.Start:
trigger = models.TriggerType_START_OF_SERVICE_DATA_FLOW
trigger = models.ChfConvergedChargingTriggerType_START_OF_SERVICE_DATA_FLOW
case usarTrigger.Immer:
logger.PduSessLog.Trace("Reports Query by SMF, trigger should be filled later")
return ""
case usarTrigger.Termr:
trigger = models.TriggerType_FINAL
trigger = models.ChfConvergedChargingTriggerType_FINAL
default:
logger.PduSessLog.Trace("Report is not a charging trigger")
return ""
Expand Down
61 changes: 39 additions & 22 deletions internal/context/sm_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ type UsageReport struct {
UplinkPktNum uint64
DownlinkPktNum uint64

ReportTpye models.TriggerType
ReportTpye models.ChfConvergedChargingTriggerType
}

var TeidGenerator *idgenerator.IDGenerator

type SMContext struct {
*models.SmContextCreateData
*models.SmfPduSessionSmContextCreateData

Ref string

Expand Down Expand Up @@ -154,9 +154,9 @@ type SMContext struct {
// Client
CommunicationClientApiPrefix string

AMFProfile models.NfProfile
SelectedPCFProfile models.NfProfile
SelectedCHFProfile models.NfProfile
AMFProfile models.NrfNfDiscoveryNfProfile
SelectedPCFProfile models.NrfNfDiscoveryNfProfile
SelectedCHFProfile models.NrfNfDiscoveryNfProfile
SmStatusNotifyUri string

Tunnel *UPTunnel
Expand Down Expand Up @@ -429,8 +429,8 @@ func (smContext *SMContext) GenerateUrrId() {
}
}

func (smContext *SMContext) BuildCreatedData() *models.SmContextCreatedData {
return &models.SmContextCreatedData{
func (smContext *SMContext) BuildCreatedData() *models.SmfPduSessionSmContextCreatedData {
return &models.SmfPduSessionSmContextCreatedData{
SNssai: smContext.SNssai,
}
}
Expand Down Expand Up @@ -576,23 +576,43 @@ func (c *SMContext) AllocUeIP() error {
return nil
}

// This function create a data path to be default data path.
func (c *SMContext) SelectDefaultDataPath() error {
// This function create ULCL data paths.
func (c *SMContext) SelectULCLDataPaths() error {
if c.SelectionParam == nil || c.SelectedUPF == nil {
return fmt.Errorf("SelectDefaultDataPath err: SelectionParam or SelectedUPF is nil")
return fmt.Errorf("SelectULCLDataPath err: SelectionParam or SelectedUPF is nil")
}

var defaultPath *DataPath
if GetSelf().ULCLSupport && CheckUEHasPreConfig(c.Supi) {
c.Log.Infof("Has pre-config default path")
c.Log.Infof("Has pre-config ULCL paths")
uePreConfigPaths := GetUEPreConfigPaths(c.Supi, c.SelectedUPF.Name)
for _, dp := range uePreConfigPaths.DataPathPool {
if !dp.IsDefaultPath {
c.Tunnel.AddDataPath(dp)
}
}
}
return nil
}

// This function create a data path to be default data path.
func (c *SMContext) SelectDefaultDataPath() error {
if c.SelectionParam == nil || c.SelectedUPF == nil {
return fmt.Errorf("SelectDefaultDataPath err: SelectionParam or SelectedUPF is nil")
}

defaultPath := c.Tunnel.DataPathPool.GetDefaultPath()
if defaultPath != nil {
// A default path already exists.
// Use this one.
c.Log.Infof("Has default path")
defaultPath = c.Tunnel.DataPathPool.GetDefaultPath()
} else if GetSelf().ULCLSupport && CheckUEHasPreConfig(c.Supi) {
// Fallback on pre-config default path
c.Log.Infof("Has pre-config default path")
uePreConfigPaths := GetUEPreConfigPaths(c.Supi, c.SelectedUPF.Name)
defaultPath = uePreConfigPaths.DataPathPool.GetDefaultPath()
} else if c.Tunnel.DataPathPool.GetDefaultPath() == nil {
c.Tunnel.AddDataPath(defaultPath)
} else {
// UE has no pre-config path and default path
// Use default route
c.Log.Infof("Has no pre-config route. Has no default path")
Expand All @@ -603,9 +623,6 @@ func (c *SMContext) SelectDefaultDataPath() error {
defaultPath.IsDefaultPath = true
c.Tunnel.AddDataPath(defaultPath)
}
} else {
c.Log.Infof("Has no pre-config route. Has default path")
defaultPath = c.Tunnel.DataPathPool.GetDefaultPath()
}

if defaultPath == nil {
Expand All @@ -626,7 +643,7 @@ func (c *SMContext) CreatePccRuleDataPath(pccRule *PCCRule,
) error {
var targetRoute models.RouteToLocation
if tcData != nil && len(tcData.RouteToLocs) > 0 {
targetRoute = tcData.RouteToLocs[0]
targetRoute = *tcData.RouteToLocs[0]
}
param := &UPFSelectionParams{
Dnn: c.Dnn,
Expand Down Expand Up @@ -680,7 +697,7 @@ func (c *SMContext) BuildUpPathChgEventExposureNotification(
return
}

en := models.EventNotification{
en := models.SmfEventExposureEventNotification{
Event: models.SmfEvent_UP_PATH_CH,
SourceTraRouting: srcRoute,
TargetTraRouting: tgtRoute,
Expand All @@ -699,7 +716,7 @@ func (c *SMContext) BuildUpPathChgEventExposureNotification(
v.EventNotifs = append(v.EventNotifs, en)
} else {
c.UpPathChgEarlyNotification[k] = newEventExposureNotification(
chgEvent.NotificationUri, chgEvent.NotifCorreId, en)
chgEvent.NotificationUri, chgEvent.NotifCorreId, &en)
}
}
if strings.Contains(string(chgEvent.DnaiChgType), "LATE") {
Expand All @@ -709,19 +726,19 @@ func (c *SMContext) BuildUpPathChgEventExposureNotification(
v.EventNotifs = append(v.EventNotifs, en)
} else {
c.UpPathChgLateNotification[k] = newEventExposureNotification(
chgEvent.NotificationUri, chgEvent.NotifCorreId, en)
chgEvent.NotificationUri, chgEvent.NotifCorreId, &en)
}
}
}

func newEventExposureNotification(
uri, id string,
en models.EventNotification,
en *models.SmfEventExposureEventNotification,
) *EventExposureNotification {
return &EventExposureNotification{
NsmfEventExposureNotification: &models.NsmfEventExposureNotification{
NotifId: id,
EventNotifs: []models.EventNotification{en},
EventNotifs: []models.SmfEventExposureEventNotification{*en},
},
Uri: uri,
}
Expand Down
4 changes: 2 additions & 2 deletions internal/context/sm_context_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ func checkUpPathChangeEvt(c *SMContext,
return fmt.Errorf("No RouteToLocs in srcTcData")
}
// TODO: Fix always choosing the first RouteToLocs as source Route
srcRoute = srcTcData.RouteToLocs[0]
srcRoute = *srcTcData.RouteToLocs[0]
// If no target TcData, the default UpPathChgEvent will be the one in source TcData
upPathChgEvt = srcTcData.UpPathChgEvent
} else {
Expand All @@ -391,7 +391,7 @@ func checkUpPathChangeEvt(c *SMContext,
return fmt.Errorf("No RouteToLocs in tgtTcData")
}
// TODO: Fix always choosing the first RouteToLocs as target Route
tgtRoute = tgtTcData.RouteToLocs[0]
tgtRoute = *tgtTcData.RouteToLocs[0]
// If target TcData is available, change UpPathChgEvent to the one in target TcData
upPathChgEvt = tgtTcData.UpPathChgEvent
} else {
Expand Down
Loading
Loading