mirror of
https://github.com/vishvananda/netlink.git
synced 2025-10-11 02:30:13 +08:00
# rule: fix 32-bit platforms don't support adding rules with a mark value of 0x80000000/0xF0000000 ~ 0xF0000000/0xF0000000
The maximum value for an `int` type on a 32-bit platform is 0x7FFFFFFF. Since 0xF0000000 exceeds this limit, we need to use `uint` instead of `int` to handle these values.
This commit is contained in:

committed by
Alessandro Boch

parent
d13535d71e
commit
8f96fd8b2f
8
rule.go
8
rule.go
@@ -10,8 +10,8 @@ type Rule struct {
|
||||
Priority int
|
||||
Family int
|
||||
Table int
|
||||
Mark int
|
||||
Mask int
|
||||
Mark uint32
|
||||
Mask *uint32
|
||||
Tos uint
|
||||
TunID uint
|
||||
Goto int
|
||||
@@ -51,8 +51,8 @@ func NewRule() *Rule {
|
||||
SuppressIfgroup: -1,
|
||||
SuppressPrefixlen: -1,
|
||||
Priority: -1,
|
||||
Mark: -1,
|
||||
Mask: -1,
|
||||
Mark: 0,
|
||||
Mask: nil,
|
||||
Goto: -1,
|
||||
Flow: -1,
|
||||
}
|
||||
|
Reference in New Issue
Block a user