Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing err checks #40

Merged
merged 1 commit into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions internal/app/up-handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading