diff --git a/Dockerfile b/Dockerfile index effeb940..0d437e73 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,6 +8,7 @@ FROM golang:1.18.3-stretch AS builder LABEL maintainer="ONF " #RUN apt remove cmdtest yarn +RUN echo "deb http://archive.debian.org/debian stretch main" > /etc/apt/sources.list RUN apt-get update RUN apt-get -y install apt-transport-https ca-certificates RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg > pubkey.gpg diff --git a/context/amf_ue.go b/context/amf_ue.go index 1f58fc5d..d6f835b2 100644 --- a/context/amf_ue.go +++ b/context/amf_ue.go @@ -507,13 +507,17 @@ func (ue *AmfUe) DetachRanUe(anType models.AccessType) { func (ue *AmfUe) AttachRanUe(ranUe *RanUe) { /* detach any RanUe associated to it */ oldRanUe := ue.RanUe[ranUe.Ran.AnType] - if oldRanUe != nil { - oldRanUe.Log.Infof("Detached UeContext from OldRanUe") - ue.RanUe[ranUe.Ran.AnType].AmfUe = nil - } ue.RanUe[ranUe.Ran.AnType] = ranUe ranUe.AmfUe = ue + go func() { + time.Sleep(time.Second * 2) + if oldRanUe != nil { + oldRanUe.Log.Infof("Detached UeContext from OldRanUe") + oldRanUe.AmfUe = nil + } + }() + // set log information ue.NASLog = logger.NasLog.WithField(logger.FieldAmfUeNgapID, fmt.Sprintf("AMF_UE_NGAP_ID:%d", ranUe.AmfUeNgapId)) ue.GmmLog = logger.GmmLog.WithField(logger.FieldAmfUeNgapID, fmt.Sprintf("AMF_UE_NGAP_ID:%d", ranUe.AmfUeNgapId)) diff --git a/context/db.go b/context/db.go index f84327df..fb2d2b8a 100644 --- a/context/db.go +++ b/context/db.go @@ -175,6 +175,7 @@ func DbFetch(collName string, filter bson.M) *AmfUe { ue.ProducerLog = logger.ProducerLog.WithField(logger.FieldSupi, fmt.Sprintf("SUPI:%s", ue.Supi)) ue.AmfInstanceName = os.Getenv("HOSTNAME") ue.AmfInstanceIp = os.Getenv("POD_IP") + ue.TxLog.Errorln("amfue fetched") return ue } diff --git a/nas/nas_security/security.go b/nas/nas_security/security.go index 53af646d..2dfdd659 100644 --- a/nas/nas_security/security.go +++ b/nas/nas_security/security.go @@ -204,6 +204,7 @@ func Decode(ue *context.AmfUe, accessType models.AccessType, payload []byte) (*n if ue.SecurityContextAvailable && ue.RanUe[accessType].RRCEstablishmentCause != "0" { ue.NASLog.Warnln("Received Plain NAS message") ue.MacFailed = false + ue.SecurityContextAvailable = false if err := msg.PlainNasDecode(&payload); err != nil { return nil, err } diff --git a/ngap/dispatcher.go b/ngap/dispatcher.go index 896ce7dd..55a996aa 100644 --- a/ngap/dispatcher.go +++ b/ngap/dispatcher.go @@ -99,7 +99,7 @@ func DispatchLb(sctplbMsg *sdcoreAmfServer.SctplbMessage, Amf2RanMsgChan chan *s /* uecontext is found, submit the message to transaction queue*/ if ranUe != nil && ranUe.AmfUe != nil { ranUe.AmfUe.SetEventChannel(NgapMsgHandler) - ranUe.AmfUe.TxLog.Infof("Uecontext found. queuing ngap message to uechannel") + //ranUe.AmfUe.TxLog.Infof("Uecontext found. queuing ngap message to uechannel") ranUe.AmfUe.EventChannel.UpdateNgapHandler(NgapMsgHandler) ngapMsg := context.NgapMsg{ Ran: ran,