From 0b13bbd8a4977c4355dab0e9a533ac6574d66ed2 Mon Sep 17 00:00:00 2001 From: ianchen0119 Date: Wed, 14 Sep 2022 05:41:26 +0000 Subject: [PATCH] The DLFAR of pfcp session est req must includes forwardingParameter --- internal/context/datapath.go | 9 +++++---- internal/pfcp/message/build.go | 12 +++++++++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/internal/context/datapath.go b/internal/context/datapath.go index 9a533e2a..6264d35d 100644 --- a/internal/context/datapath.go +++ b/internal/context/datapath.go @@ -528,11 +528,12 @@ func (dataPath *DataPath) ActivateTunnelAndPDR(smContext *SMContext, precedence } } } else { + ANUPF := dataPath.FirstDPNode + DLPDR := ANUPF.DownLinkTunnel.PDR + DLFAR := DLPDR.FAR + DLFAR.ForwardingParameters = new(ForwardingParameters) + DLFAR.ForwardingParameters.DestinationInterface.InterfaceValue = pfcpType.DestinationInterfaceAccess if anIP := smContext.Tunnel.ANInformation.IPAddress; anIP != nil { - ANUPF := dataPath.FirstDPNode - DLPDR := ANUPF.DownLinkTunnel.PDR - DLFAR := DLPDR.FAR - DLFAR.ForwardingParameters = new(ForwardingParameters) DLFAR.ForwardingParameters.DestinationInterface.InterfaceValue = pfcpType.DestinationInterfaceAccess DLFAR.ForwardingParameters.NetworkInstance = &pfcpType.NetworkInstance{NetworkInstance: smContext.Dnn} DLFAR.ForwardingParameters.OuterHeaderCreation = new(pfcpType.OuterHeaderCreation) diff --git a/internal/pfcp/message/build.go b/internal/pfcp/message/build.go index a1da60b1..2c70caca 100644 --- a/internal/pfcp/message/build.go +++ b/internal/pfcp/message/build.go @@ -111,7 +111,17 @@ func farToCreateFAR(far *context.FAR) *pfcp.CreateFAR { createFAR.FARID.FarIdValue = far.FARID createFAR.ApplyAction = new(pfcpType.ApplyAction) - createFAR.ApplyAction.Forw = true + if far.ForwardingParameters != nil { + createFAR.ApplyAction.Forw = true + } else { + /* + 29.244 v15.3 Table 7.5.2.3-1 + Farwarding Parameters IE shall be present when the Apply-Action requests the packets to be forwarded. + */ + // FAR without Farwarding Parameters set Apply Action as Drop instead of Forward. + createFAR.ApplyAction.Forw = false + createFAR.ApplyAction.Drop = true + } if far.BAR != nil { createFAR.BARID = new(pfcpType.BARID)