Skip to content

Commit

Permalink
[#356] netmap: Fix post-loop handling of zero subnet in IterateSubnets
Browse files Browse the repository at this point in the history
Return any error other than `ErrRemoveSubnet` from `IterateSubnets`
during post-loop processing of zero subnet.

Signed-off-by: Leonard Lyubich <[email protected]>
  • Loading branch information
Leonard Lyubich authored and cthulhu-rider committed Nov 24, 2021
1 parent 5ce4b22 commit d93828f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion netmap/attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,11 @@ func IterateSubnets(node *NodeInfo, f func(refs.SubnetID) error) error {
refs.MakeZeroSubnet(&id)

err = f(id)
if errors.Is(err, ErrRemoveSubnet) {
if err != nil {
if !errors.Is(err, ErrRemoveSubnet) {
return err
}

// zero subnet should be clearly removed with False value
var attr Attribute

Expand Down

0 comments on commit d93828f

Please sign in to comment.