From b1536bf12c685dcbdcdd35d73f9d7375ebb95bc4 Mon Sep 17 00:00:00 2001 From: chantra Date: Sun, 4 Oct 2015 22:34:02 -0700 Subject: [PATCH] Address comments * fix package import order * use int instead of int32 for Filter FW Attrs --- filter.go | 4 ++-- filter_linux.go | 3 ++- filter_test.go | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) 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) {