Skip to content

Commit

Permalink
fix: delete UPF.UPIPInfo field
Browse files Browse the repository at this point in the history
fixes #137
  • Loading branch information
yoursunny committed Dec 13, 2024
1 parent 62925c4 commit b1b5eba
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 23 deletions.
14 changes: 0 additions & 14 deletions internal/context/upf.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ type UPF struct {
uuid uuid.UUID
NodeID pfcpType.NodeID
Addr string
UPIPInfo pfcpType.UserPlaneIPResourceInformation
RecoveryTimeStamp time.Time

AssociationContext context.Context
Expand Down Expand Up @@ -353,19 +352,6 @@ func RemoveUPFNodeByNodeID(nodeID pfcpType.NodeID) bool {
return false
}

func SelectUPFByDnn(dnn string) *UPF {
var upf *UPF
upfPool.Range(func(key, value interface{}) bool {
upf = value.(*UPF)
if upf.UPIPInfo.Assoni && upf.UPIPInfo.NetworkInstance.NetworkInstance == dnn {
return false
}
upf = nil
return true
})
return upf
}

func (upf *UPF) GetUPFIP() string {
upfIP := upf.NodeID.ResolveNodeIdToIp().String()
return upfIP
Expand Down
2 changes: 0 additions & 2 deletions internal/pfcp/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ func HandlePfcpAssociationSetupRequest(msg *pfcpUdp.Message) {
return
}

upf.UPIPInfo = *req.UserPlaneIPResourceInformation

// Response with PFCP Association Setup Response
cause := pfcpType.Cause{
CauseValue: pfcpType.CauseRequestAccepted,
Expand Down
8 changes: 1 addition & 7 deletions internal/sbi/processor/association.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,7 @@ func setupPfcpAssociation(upf *smf_context.UPF, upfStr string) error {
}

logger.MainLog.Infof("Received PFCP Association Setup Accepted Response from UPF%s", upfStr)

if rsp.UserPlaneIPResourceInformation != nil {
upf.UPIPInfo = *rsp.UserPlaneIPResourceInformation

logger.MainLog.Infof("UPF(%s)[%s] setup association",
upf.NodeID.ResolveNodeIdToIp().String(), upf.UPIPInfo.NetworkInstance.NetworkInstance)
}
logger.MainLog.Infof("UPF(%s) setup association", upf.NodeID.ResolveNodeIdToIp().String())

return nil
}
Expand Down

0 comments on commit b1b5eba

Please sign in to comment.