diff --git a/internal/app/up-handler.go b/internal/app/up-handler.go index bbea93f..85982a3 100644 --- a/internal/app/up-handler.go +++ b/internal/app/up-handler.go @@ -99,6 +99,13 @@ func tpduHandler(iface string, c gtpv1.Conn, senderAddr net.Addr, msg message.Me return err } pfcpSession, err := pfcpSessionLookUp(true, msg.TEID(), iface, packet, pfcpServer) + if err != nil { + logrus.WithError(err).WithFields(logrus.Fields{ + "teid": msg.TEID(), + "interface": iface, + }).Error("Could not find Session for this GTP packet") + return err + } defer pfcpSession.RUnlock() pdr, err := pfcpSessionPDRLookUp(pfcpSession, true, msg.TEID(), iface, packet) if err != nil { diff --git a/internal/config/config.go b/internal/config/config.go index 20121f8..1c08f20 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -15,6 +15,9 @@ import ( func ParseConf(file string) (*UpfConfig, error) { var conf UpfConfig path, err := filepath.Abs(file) + if err != nil { + return nil, err + } yamlFile, err := ioutil.ReadFile(path) if err != nil { return nil, err