Skip to content

Commit

Permalink
extend FAR_APPLY_ACTION to u16 to fit R16
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-ywliu committed Oct 20, 2022
1 parent ddf2950 commit 8892d6d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions attr_far.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const (

type FAR struct {
ID uint32
Action uint8
Action uint16
Param *ForwardParam
PDRIDs []uint16
BARID *uint8
Expand All @@ -35,7 +35,7 @@ func DecodeFAR(b []byte) (*FAR, error) {
case FAR_ID:
far.ID = native.Uint32(b[n:])
case FAR_APPLY_ACTION:
far.Action = b[n]
far.Action = native.Uint16(b[n:])
case FAR_FORWARDING_PARAMETER:
param, err := DecodeForwardParam(b[n:])
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/gogtp5g-tunnel/cmd_far.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func ParseFAROptions(args []string) ([]nl.Attr, error) {
}
attrs = append(attrs, nl.Attr{
Type: gtp5gnl.FAR_APPLY_ACTION,
Value: nl.AttrU8(v),
Value: nl.AttrU16(v),
})
case "--hdr-creation":
// --hdr-creation <description> <o-teid> <peer-ipv4> <peer-port>
Expand Down
2 changes: 1 addition & 1 deletion far.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

// m LINK: ifindex
// m FAR_ID: u32
// m FAR_APPLY_ACTION: u8
// m FAR_APPLY_ACTION: u16
// m FAR_FORWARDING_PARAMETER {
// m FORWARDING_PARAMETER_OUTER_HEADER_CREATION {
// OUTER_HEADER_CREATION_DESCRIPTION: u16
Expand Down
2 changes: 1 addition & 1 deletion far_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestCreateFAR(t *testing.T) {
attrs := []nl.Attr{
{
Type: FAR_APPLY_ACTION,
Value: nl.AttrU8(1),
Value: nl.AttrU16(1),
},
{
Type: FAR_FORWARDING_PARAMETER,
Expand Down

0 comments on commit 8892d6d

Please sign in to comment.