Address comments

* fix package import order
* use int instead of int32 for Filter FW Attrs
This commit is contained in:
chantra
2015-10-04 22:34:02 -07:00
parent 824d7a16e5
commit b1536bf12c
3 changed files with 6 additions and 4 deletions

View File

@@ -52,7 +52,7 @@ type FilterFwAttrs struct {
Rate uint32 Rate uint32
AvRate uint32 AvRate uint32
PeakRate uint32 PeakRate uint32
Action int32 Action int
Overhead uint16 Overhead uint16
LinkLayer int LinkLayer int
} }
@@ -86,7 +86,7 @@ func NewFw(attrs FilterAttrs, fattrs FilterFwAttrs) (*Fw, error) {
linklayer = fattrs.LinkLayer linklayer = fattrs.LinkLayer
} }
police.Action = fattrs.Action police.Action = int32(fattrs.Action)
if police.Rate.Rate != 0 { if police.Rate.Rate != 0 {
police.Rate.Mpu = fattrs.Mpu police.Rate.Mpu = fattrs.Mpu
police.Rate.Overhead = fattrs.Overhead police.Rate.Overhead = fattrs.Overhead

View File

@@ -4,8 +4,9 @@ import (
"bytes" "bytes"
"encoding/binary" "encoding/binary"
"fmt" "fmt"
"github.com/vishvananda/netlink/nl"
"syscall" "syscall"
"github.com/vishvananda/netlink/nl"
) )
// FilterDel will delete a filter from the system. // FilterDel will delete a filter from the system.

View File

@@ -1,9 +1,10 @@
package netlink package netlink
import ( import (
"github.com/vishvananda/netlink/nl"
"syscall" "syscall"
"testing" "testing"
"github.com/vishvananda/netlink/nl"
) )
func TestFilterAddDel(t *testing.T) { func TestFilterAddDel(t *testing.T) {