pkg,plugins: update for Result struct Interface index changes
It's a pointer now, so we need to use the helper function to set the field and also test for nil before accessing it.
This commit is contained in:
@ -164,9 +164,14 @@ func parseConfig(stdin []byte, ifName string) (*PortMapConf, error) {
|
||||
}
|
||||
|
||||
// Skip known non-sandbox interfaces
|
||||
intIdx := ip.Interface
|
||||
if intIdx >= 0 && intIdx < len(conf.PrevResult.Interfaces) && conf.PrevResult.Interfaces[intIdx].Name != ifName {
|
||||
continue
|
||||
if ip.Interface != nil {
|
||||
intIdx := *ip.Interface
|
||||
if intIdx >= 0 &&
|
||||
intIdx < len(conf.PrevResult.Interfaces) &&
|
||||
(conf.PrevResult.Interfaces[intIdx].Name != ifName ||
|
||||
conf.PrevResult.Interfaces[intIdx].Sandbox == "") {
|
||||
continue
|
||||
}
|
||||
}
|
||||
switch ip.Version {
|
||||
case "6":
|
||||
|
Reference in New Issue
Block a user