fix: nic config logic error
This commit is contained in:
parent
21b795732c
commit
a551154b96
@ -28,13 +28,13 @@ func GetState(ctx context.Context) ([]uint64, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
allowList := excludeNetInterfaces
|
allowList, _ := ctx.Value(NICKey).(map[string]bool)
|
||||||
if m, ok := ctx.Value(NICKey).(map[string]bool); ok && len(m) > 0 {
|
|
||||||
allowList = m
|
|
||||||
}
|
|
||||||
|
|
||||||
for _, v := range nc {
|
for _, v := range nc {
|
||||||
if !allowList[v.Name] {
|
if excludeNetInterfaces[v.Name] && !allowList[v.Name] {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if len(allowList) > 0 && !allowList[v.Name] {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
netInTransfer += v.BytesRecv
|
netInTransfer += v.BytesRecv
|
||||||
|
Loading…
x
Reference in New Issue
Block a user