diff --git a/filter.go b/filter.go index 8779afa..80ef34d 100644 --- a/filter.go +++ b/filter.go @@ -52,7 +52,7 @@ type FilterFwAttrs struct { Rate uint32 AvRate uint32 PeakRate uint32 - Action int32 + Action int Overhead uint16 LinkLayer int } @@ -86,7 +86,7 @@ func NewFw(attrs FilterAttrs, fattrs FilterFwAttrs) (*Fw, error) { linklayer = fattrs.LinkLayer } - police.Action = fattrs.Action + police.Action = int32(fattrs.Action) if police.Rate.Rate != 0 { police.Rate.Mpu = fattrs.Mpu police.Rate.Overhead = fattrs.Overhead diff --git a/filter_linux.go b/filter_linux.go index fc22a8a..1dc688b 100644 --- a/filter_linux.go +++ b/filter_linux.go @@ -4,8 +4,9 @@ import ( "bytes" "encoding/binary" "fmt" - "github.com/vishvananda/netlink/nl" "syscall" + + "github.com/vishvananda/netlink/nl" ) // FilterDel will delete a filter from the system. diff --git a/filter_test.go b/filter_test.go index 2da9dda..8353d25 100644 --- a/filter_test.go +++ b/filter_test.go @@ -1,9 +1,10 @@ package netlink import ( - "github.com/vishvananda/netlink/nl" "syscall" "testing" + + "github.com/vishvananda/netlink/nl" ) func TestFilterAddDel(t *testing.T) {