Skip to content

Commit

Permalink
Fixed action in FAR in pfcpiface controller.
Browse files Browse the repository at this point in the history
Signed-off-by: Muhammad Asim Jamshed <muhammad.jamshed@intel.com>
  • Loading branch information
ajamshed authored and krsna1729 committed Jul 30, 2020
1 parent 2de8828 commit df3544e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions pfcpiface/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ func parseCreatePDR(ie1 *ie.IE, fseid *ie.FSEIDFields) *pdr {
return &pdrI
}

func parseCreateFAR(ie1 *ie.IE, fseid uint64, n6IP net.IP) *far {
return parseFAR(ie1, fseid, n6IP, "create")
func parseCreateFAR(ie1 *ie.IE, fseid uint64, n6IP net.IP, dir uint8) *far {
return parseFAR(ie1, fseid, n6IP, "create", dir)
}

func parseUpdateFAR(ie1 *ie.IE, fseid uint64, n3IP net.IP) *far {
return parseFAR(ie1, fseid, n3IP, "update")
func parseUpdateFAR(ie1 *ie.IE, fseid uint64, n3IP net.IP, dir uint8) *far {
return parseFAR(ie1, fseid, n3IP, "update", dir)
}

func parseFAR(ie1 *ie.IE, fseid uint64, n3IP net.IP, fwdType string) *far {
func parseFAR(ie1 *ie.IE, fseid uint64, n3IP net.IP, fwdType string, dir uint8) *far {
farID, err := ie1.FARID()
if err != nil {
log.Println("Could not read FAR ID!")
Expand Down Expand Up @@ -175,7 +175,7 @@ func parseFAR(ie1 *ie.IE, fseid uint64, n3IP net.IP, fwdType string) *far {
return &far{
farID: uint8(farID), // farID currently being truncated to uint8 <--- FIXIT/TODO/XXX
fseID: uint32(fseid), // fseID currently being truncated to uint32 <--- FIXIT/TODO/XXX
action: farForwardU,
action: dir,
tunnelType: tunnelType,
s1uIP: n6IP4,
eNBIP: eNBIP,
Expand Down Expand Up @@ -207,7 +207,7 @@ func parsePDRFromPFCPSessEstReqPayload(upf *upf, sereq *message.SessionEstablish
}

case ie.CreateFAR:
if f := parseCreateFAR(ie1, fseid.SEID, upf.n6IP); f != nil {
if f := parseCreateFAR(ie1, fseid.SEID, upf.n6IP, farForwardU); f != nil {
fars = append(fars, *f)
}
}
Expand Down
2 changes: 1 addition & 1 deletion pfcpiface/pfcpiface.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ func handleSessionModificationRequest(upf *upf, msg message.Message, addr net.Ad
for _, ie1 := range ies1 {
switch ie1.Type {
case ie.UpdateFAR:
if f := parseUpdateFAR(ie1, fseid, upf.n3IP); f != nil {
if f := parseUpdateFAR(ie1, fseid, upf.n3IP, farForwardD); f != nil {
fars = append(fars, *f)
}
default:
Expand Down

0 comments on commit df3544e

Please sign in to comment.