mirror of
https://github.com/vishvananda/netlink.git
synced 2025-10-04 23:42:54 +08:00
Address comments
* fix package import order * use int instead of int32 for Filter FW Attrs
This commit is contained in:
@@ -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
|
||||||
|
@@ -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.
|
||||||
|
@@ -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) {
|
||||||
|
Reference in New Issue
Block a user