Skip to content

Commit

Permalink
Fix GTP-TEID setting for target-RAN during XnHandover. (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
matsumu-y authored Aug 2, 2021
1 parent a5c852b commit 8597605
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions context/ngap_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,10 @@ func HandlePathSwitchRequestTransfer(b []byte, ctx *SMContext) error {

gtpTunnel := pathSwitchRequestTransfer.DLNGUUPTNLInformation.GTPTunnel

TEIDReader := bytes.NewBuffer(gtpTunnel.GTPTEID.Value)
teid := binary.BigEndian.Uint32(gtpTunnel.GTPTEID.Value)

teid, err := binary.ReadUvarint(TEIDReader)
if err != nil {
return fmt.Errorf("Parse TEID error %s", err.Error())
}
ctx.Tunnel.ANInformation.IPAddress = gtpTunnel.TransportLayerAddress.Value.Bytes
ctx.Tunnel.ANInformation.TEID = teid

for _, dataPath := range ctx.Tunnel.DataPathPool {
if dataPath.Activated {
Expand All @@ -116,8 +114,8 @@ func HandlePathSwitchRequestTransfer(b []byte, ctx *SMContext) error {
DLPDR.FAR.ForwardingParameters.OuterHeaderCreation = new(pfcpType.OuterHeaderCreation)
dlOuterHeaderCreation := DLPDR.FAR.ForwardingParameters.OuterHeaderCreation
dlOuterHeaderCreation.OuterHeaderCreationDescription = pfcpType.OuterHeaderCreationGtpUUdpIpv4
dlOuterHeaderCreation.Teid = uint32(teid)
dlOuterHeaderCreation.Ipv4Address = gtpTunnel.TransportLayerAddress.Value.Bytes
dlOuterHeaderCreation.Teid = teid
dlOuterHeaderCreation.Ipv4Address = ctx.Tunnel.ANInformation.IPAddress.To4()
DLPDR.FAR.State = RULE_UPDATE
}
}
Expand Down

0 comments on commit 8597605

Please sign in to comment.