Skip to content

Commit

Permalink
fix: fix line length
Browse files Browse the repository at this point in the history
  • Loading branch information
a3828162 committed Apr 17, 2024
1 parent 5f26d8b commit 4b7cb43
Show file tree
Hide file tree
Showing 6 changed files with 665 additions and 181 deletions.
6 changes: 5 additions & 1 deletion internal/nwucp/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ func Dispatch(conn net.Conn, nasEnv []byte) {

// Decap Nas envelope
nasEnv, _ = ngapPacket.DecapNasPduFromEnvelope(nasEnv[:])
nasMsg, err := n3ue_security.NASDecode(n3ueSelf.RanUeContext, nas.SecurityHeaderTypeIntegrityProtectedAndCiphered, nasEnv[:len((nasEnv))])
nasMsg, err := n3ue_security.NASDecode(
n3ueSelf.RanUeContext,
nas.SecurityHeaderTypeIntegrityProtectedAndCiphered,
nasEnv[:len((nasEnv))],

Check failure on line 39 in internal/nwucp/dispatcher.go

View workflow job for this annotation

GitHub Actions / lint (1.21)

S1010: should omit second index in slice, s[a:len(s)] is identical to s[a:] (gosimple)
)
if err != nil {
naslog.Errorf("NAS Decode Fail: %+v", err)
return
Expand Down
12 changes: 10 additions & 2 deletions internal/packet/nasPacket/nasPduDl.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,21 @@ import (
"github.com/free5gc/nas/nasMessage"
)

func DecodePDUSessionEstablishmentAccept(ue *n3ue_security.RanUeContext, length int, buffer []byte) (*nas.Message, error) {
func DecodePDUSessionEstablishmentAccept(
ue *n3ue_security.RanUeContext,
length int,
buffer []byte,
) (*nas.Message, error) {
if length == 0 {
return nil, fmt.Errorf("Empty buffer")
}

nasEnv, n := ngapPacket.DecapNasPduFromEnvelope(buffer[:length])
nasMsg, err := n3ue_security.NASDecode(ue, nas.SecurityHeaderTypeIntegrityProtectedAndCiphered, nasEnv[:n])
nasMsg, err := n3ue_security.NASDecode(
ue,
nas.SecurityHeaderTypeIntegrityProtectedAndCiphered,
nasEnv[:n],
)
if err != nil {
return nil, fmt.Errorf("NAS Decode Fail: %+v", err)
}
Expand Down
Loading

0 comments on commit 4b7cb43

Please sign in to comment.