Tries to fully populate Set.KeyType if it's a simple type.
Set.DataType also gets the full type descriptor. No changes in behavior for concatenated datatypes.
This commit is contained in:
parent
3a4a2bce5f
commit
16a134723a
7
set.go
7
set.go
|
@ -591,6 +591,13 @@ func setsFromMsg(msg netlink.Message) (*Set, error) {
|
||||||
return nil, fmt.Errorf("could not determine key type %+v", invalidMagic)
|
return nil, fmt.Errorf("could not determine key type %+v", invalidMagic)
|
||||||
}
|
}
|
||||||
set.KeyType.nftMagic = nftMagic
|
set.KeyType.nftMagic = nftMagic
|
||||||
|
for _, dt := range nftDatatypes {
|
||||||
|
// If this is a non-concatenated type, we can assign the descriptor.
|
||||||
|
if nftMagic == dt.nftMagic {
|
||||||
|
set.KeyType = dt
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
case unix.NFTA_SET_DATA_TYPE:
|
case unix.NFTA_SET_DATA_TYPE:
|
||||||
nftMagic := ad.Uint32()
|
nftMagic := ad.Uint32()
|
||||||
// Special case for the data type verdict, in the message it is stored as 0xffffff00 but it is defined as 1
|
// Special case for the data type verdict, in the message it is stored as 0xffffff00 but it is defined as 1
|
||||||
|
|
Loading…
Reference in New Issue