Skip to content

Commit

Permalink
fix: return created PDRs
Browse files Browse the repository at this point in the history
Signed-off-by: Guillaume Belanger <guillaume.belanger27@gmail.com>
  • Loading branch information
gruyaume committed Oct 17, 2024
1 parent eb7fe16 commit a07f5a5
Showing 1 changed file with 19 additions and 22 deletions.
41 changes: 19 additions & 22 deletions pfcpiface/session_pdr.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,30 +30,27 @@ func addPdrInfo(msg *message.SessionEstablishmentResponse, session *PFCPSession)
logger.PfcpLog.Infoln("add PDRs with UPF alloc IPs to Establishment response")

for _, pdr := range session.pdrs {
if (pdr.allocIPFlag) && (pdr.srcIface == core) {
logger.PfcpLog.Debugln("pdrID:", pdr.pdrID)

var (
flags uint8 = 0x02
ueIP net.IP = int2ip(pdr.ueAddress)
)

if ueIP != nil {
logger.PfcpLog.Debugln("ueIP:", ueIP.String())
msg.CreatedPDR = append(msg.CreatedPDR,
ie.NewCreatedPDR(
ie.NewPDRID(uint16(pdr.pdrID)),
ie.NewUEIPAddress(flags, ueIP.String(), "", 0, 0),
))
} else {
msg.CreatedPDR = append(msg.CreatedPDR,
ie.NewCreatedPDR(
ie.NewPDRID(uint16(pdr.pdrID)),
ie.NewFTEID(0x01, pdr.tunnelTEID, int2ip(pdr.tunnelIP4Dst), nil, 0),
))
}
var (
flags uint8 = 0x02
ueIP net.IP = int2ip(pdr.ueAddress)
)
logger.PfcpLog.Debugln("Adding PDR ID:", pdr.pdrID)

if ueIP != nil {
logger.PfcpLog.Debugln("ueIP:", ueIP.String())
msg.CreatedPDR = append(msg.CreatedPDR,
ie.NewCreatedPDR(
ie.NewPDRID(uint16(pdr.pdrID)),
ie.NewUEIPAddress(flags, ueIP.String(), "", 0, 0),
))
} else {
msg.CreatedPDR = append(msg.CreatedPDR,
ie.NewCreatedPDR(
ie.NewPDRID(uint16(pdr.pdrID)),
ie.NewFTEID(0x01, pdr.tunnelTEID, int2ip(pdr.tunnelIP4Dst), nil, 0),
))
}

}
}

Expand Down

0 comments on commit a07f5a5

Please sign in to comment.