Skip to content

Commit

Permalink
fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
louisroyer committed Nov 28, 2024
1 parent 28be70f commit 2ef565b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/app/pdu_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,17 @@ func (p *PduSessions) EstablishmentRequest(c *gin.Context) {
logrus.WithFields(logrus.Fields{
"ue": ps.Ue.String(),
"gnb": ps.Gnb.String(),
"dnn": ps.Dnn,
}).Info("New PDU Session establishment Request")

// allocate new ue ip addr
UeIpAddr, err := p.Pools[ps.Dnn].Next()
pool, ok := p.Pools[ps.Dnn]
if !ok {
logrus.Error("unknown pool")
c.JSON(http.StatusInternalServerError, jsonapi.MessageWithError{Message: "unknown pool", Error: nil})
return
}
UeIpAddr, err := pool.Next()
if err != nil {
logrus.WithError(err).Error("no address available in pool")
c.JSON(http.StatusInternalServerError, jsonapi.MessageWithError{Message: "no address available in pool", Error: err})
Expand Down

0 comments on commit 2ef565b

Please sign in to comment.