Skip to content

Commit

Permalink
check measurePeriod before apply URR (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianchen0119 committed Jun 8, 2023
1 parent e623954 commit 4474dc8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/forwarder/gtp5g.go
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,9 @@ func (g *Gtp5g) CreateURR(lSeid uint64, req *ie.IE) error {
if err != nil {
return err
}
if measurePeriod <= 0 {
return errors.New("invalid measurement period")
}
// TODO: convert time.Duration -> ?
attrs = append(attrs, nl.Attr{
Type: gtp5gnl.URR_MEASUREMENT_PERIOD,
Expand Down Expand Up @@ -1168,6 +1171,9 @@ func (g *Gtp5g) CreateURR(lSeid uint64, req *ie.IE) error {
}

if rptTrig.PERIO() {
if measurePeriod <= 0 {
return errors.New("invalid measurement period")
}
g.ps.AddPeriodReportTimer(lSeid, urrid, measurePeriod)
}

Expand Down

0 comments on commit 4474dc8

Please sign in to comment.