Skip to content

Commit

Permalink
fix: ULCL not working; close free5gc#141
Browse files Browse the repository at this point in the history
  • Loading branch information
louisroyer committed Feb 26, 2025
1 parent 9ab42f1 commit adea19c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
20 changes: 19 additions & 1 deletion internal/context/sm_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,24 @@ func (c *SMContext) AllocUeIP() error {
return nil
}

// 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")
}

if GetSelf().ULCLSupport && CheckUEHasPreConfig(c.Supi) {
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 {
Expand All @@ -587,7 +605,7 @@ func (c *SMContext) SelectDefaultDataPath() error {
c.Log.Infof("Has pre-config default path")
uePreConfigPaths := GetUEPreConfigPaths(c.Supi, c.SelectedUPF.Name)
for _, dp := range uePreConfigPaths.DataPathPool {
if !dp.IsDefaultPath {
if dp.IsDefaultPath {
c.Tunnel.AddDataPath(dp)
}
}
Expand Down
10 changes: 10 additions & 0 deletions internal/sbi/processor/pdu_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,16 @@ func (p *Processor) HandlePDUSessionSMContextCreate(
return
}

// SelectULCLDataPaths() will create other paths if ULCL is enabled.
if err = smContext.SelectULCLDataPaths(); err != nil {
smContext.SetState(smf_context.InActive)
smContext.Log.Errorf("PDUSessionSMContextCreate err: %v", err)
p.makeEstRejectResAndReleaseSMContext(c, smContext,
nasMessage.Cause5GSMInsufficientResourcesForSpecificSliceAndDNN,
&Nsmf_PDUSession.InsufficientResourceSliceDnn)
return
}

// generate goroutine to handle PFCP and
// reply PDUSessionSMContextCreate rsp immediately
needUnlock = false
Expand Down

0 comments on commit adea19c

Please sign in to comment.