Skip to content

Commit

Permalink
Set UISR bit in IE Report Type for UP-dropped session with no URRs
Browse files Browse the repository at this point in the history
In this case the USAR bit is not set
  • Loading branch information
ivan4th committed Jun 7, 2021
1 parent fb41d70 commit 006b3f2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions upf/pfcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1374,10 +1374,11 @@ format_report_type (u8 * s, va_list * args)
{
pfcp_report_type_t *v = va_arg (*args, pfcp_report_type_t *);

return format (s, "DLDR:%d,USAR:%d,ERIR:%d,UPIR:%d,PMIR:%d,SESR:%d",
return format (s, "DLDR:%d,USAR:%d,ERIR:%d,UPIR:%d,PMIR:%d,SESR:%d,UISR:%d",
!!(*v & REPORT_TYPE_DLDR), !!(*v & REPORT_TYPE_USAR),
!!(*v & REPORT_TYPE_ERIR), !!(*v & REPORT_TYPE_UPIR),
!!(*v & REPORT_TYPE_PMIR), !!(*v & REPORT_TYPE_SESR));
!!(*v & REPORT_TYPE_PMIR), !!(*v & REPORT_TYPE_SESR),
!!(*v & REPORT_TYPE_UISR));
}

#define decode_report_type decode_u8_ie
Expand Down
1 change: 1 addition & 0 deletions upf/pfcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ typedef u8 pfcp_report_type_t;
#define REPORT_TYPE_UPIR BIT(3)
#define REPORT_TYPE_PMIR BIT(4)
#define REPORT_TYPE_SESR BIT(5)
#define REPORT_TYPE_UISR BIT(6)

#define PFCP_IE_OFFENDING_IE 40
typedef u32 pfcp_offending_ie_t;
Expand Down
2 changes: 1 addition & 1 deletion upf/test/session_report_request.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PFCP: seq 49, Session Report Request (56), SEID: 0x0ffde7210bf94000.
Report Type: DLDR:0,USAR:1,ERIR:0,UPIR:0,PMIR:0,SESR:0
Report Type: DLDR:0,USAR:1,ERIR:0,UPIR:0,PMIR:0,SESR:0,UISR:0
Usage Report SRR
URR ID: 3
UR-SEQN: 24
Expand Down
5 changes: 4 additions & 1 deletion upf/upf_pfcp_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -533,13 +533,14 @@ upf_pfcp_session_up_deletion_report (upf_session_t * sx)

memset (req, 0, sizeof (*req));
SET_BIT (req->grp.fields, SESSION_REPORT_REQUEST_REPORT_TYPE);
req->report_type = REPORT_TYPE_USAR;

active = pfcp_get_rules (sx, PFCP_ACTIVE);
if (vec_len (active->urr) != 0)
{
upf_usage_report_t report;

req->report_type = REPORT_TYPE_USAR;

SET_BIT (req->grp.fields, SESSION_REPORT_REQUEST_USAGE_REPORT);

upf_usage_report_init (&report, vec_len (active->urr));
Expand All @@ -550,6 +551,8 @@ upf_pfcp_session_up_deletion_report (upf_session_t * sx)
&req->usage_report);
upf_usage_report_free (&report);
}
else
req->report_type = REPORT_TYPE_UISR;

SET_BIT (req->grp.fields, SESSION_REPORT_REQUEST_PFCPSRREQ_FLAGS);
/* PSDBU = PFCP Session Deleted By the UP function */
Expand Down

0 comments on commit 006b3f2

Please sign in to comment.