Addressing comments
Signed-off-by: Serguei Bezverkhi <sbezverk@cisco.com>
This commit is contained in:
parent
8093f4aecc
commit
1bcf0471bb
|
@ -81,7 +81,7 @@ func (e *Dynset) unmarshal(data []byte) error {
|
|||
case unix.NFTA_DYNSET_OP:
|
||||
e.Operation = ad.Uint32()
|
||||
case unix.NFTA_DYNSET_TIMEOUT:
|
||||
e.Timeout = time.Duration(ad.Uint64() * 1000)
|
||||
e.Timeout = time.Duration(time.Millisecond * time.Duration(ad.Uint64()))
|
||||
case unix.NFTA_DYNSET_FLAGS:
|
||||
e.Invert = (ad.Uint32() & unix.NFT_DYNSET_F_INV) != 0
|
||||
}
|
||||
|
|
4
set.go
4
set.go
|
@ -173,7 +173,7 @@ func (s *SetElement) decode() func(b []byte) error {
|
|||
flags := ad.Uint32()
|
||||
s.IntervalEnd = (flags & unix.NFT_SET_ELEM_INTERVAL_END) != 0
|
||||
case unix.NFTA_SET_ELEM_TIMEOUT:
|
||||
s.Timeout = time.Duration(ad.Uint64() * 1000)
|
||||
s.Timeout = time.Duration(time.Millisecond * time.Duration(ad.Uint64()))
|
||||
}
|
||||
}
|
||||
return ad.Err()
|
||||
|
@ -490,7 +490,7 @@ func setsFromMsg(msg netlink.Message) (*Set, error) {
|
|||
case unix.NFTA_SET_ID:
|
||||
set.ID = binary.BigEndian.Uint32(ad.Bytes())
|
||||
case unix.NFTA_SET_TIMEOUT:
|
||||
set.Timeout = time.Duration(binary.BigEndian.Uint64(ad.Bytes()) * 1000)
|
||||
set.Timeout = time.Duration(time.Millisecond * time.Duration(binary.BigEndian.Uint64(ad.Bytes())))
|
||||
set.HasTimeout = true
|
||||
case unix.NFTA_SET_FLAGS:
|
||||
flags := ad.Uint32()
|
||||
|
|
Loading…
Reference in New Issue